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({
|
const notifications = await Notification.find({
|
||||||
monitorId: monitorId,
|
monitorId: monitorId,
|
||||||
});
|
});
|
||||||
monitor.notifications = notifications;
|
const updatedMonitor = await Monitor.findByIdAndUpdate(
|
||||||
const monitorWithNotifications = await monitor.save();
|
monitorId,
|
||||||
return monitorWithNotifications;
|
{ notifications },
|
||||||
|
{ new: true }
|
||||||
|
).populate("notifications");
|
||||||
|
return updatedMonitor;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
error.service = SERVICE_NAME;
|
error.service = SERVICE_NAME;
|
||||||
error.method = "getMonitorById";
|
error.method = "getMonitorById";
|
||||||
|
|||||||
Reference in new issue
Block a user