feature/IO-3303-Socket-IO-Optimization-Auto-Add-Watchers-Gate - SocketIO Optimization / Auto Add Watchers Gate
This commit is contained in:
@@ -50,7 +50,12 @@ const autoAddWatchers = async (req) => {
|
||||
try {
|
||||
// Fetch bodyshop data from Redis
|
||||
const bodyshopData = await getBodyshopFromRedis(shopId);
|
||||
const notificationFollowers = bodyshopData?.notification_followers || [];
|
||||
let notificationFollowers = bodyshopData?.notification_followers;
|
||||
|
||||
// Bail if notification_followers is missing or not an array
|
||||
if (!notificationFollowers || !Array.isArray(notificationFollowers)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute queries in parallel
|
||||
const [notificationData, existingWatchersData] = await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user