Fix concurrency error with updating monitor, uncomment out code in pageSpeedMonitorSlice
This commit is contained in:
1 parent
86ab22df03
commit
8730ee9de2
1 file changed
+6
-3
@@ -296,9 +296,12 @@ const getMonitorById = async (monitorId) => {
|
||||
const notifications = await Notification.find({
|
||||
monitorId: monitorId,
|
||||
});
|
||||
monitor.notifications = notifications;
|
||||
const monitorWithNotifications = await monitor.save();
|
||||
return monitorWithNotifications;
|
||||
const updatedMonitor = await Monitor.findByIdAndUpdate(
|
||||
monitorId,
|
||||
{ notifications },
|
||||
{ new: true }
|
||||
).populate("notifications");
|
||||
return updatedMonitor;
|
||||
} catch (error) {
|
||||
error.service = SERVICE_NAME;
|
||||
error.method = "getMonitorById";
|
||||
|
||||
Reference in new issue
Block a user