Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Jan 8, 2025
2 parents 10a199f + 2df9739 commit e14c54c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ProbeIngest/API/ServerMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import MonitorResourceUtil from "Common/Server/Utils/Monitor/MonitorResource";
import Response from "Common/Server/Utils/Response";
import Monitor from "Common/Models/DatabaseModels/Monitor";
import OneUptimeDate from "Common/Types/Date";
import ProjectService from "Common/Server/Services/ProjectService";

const router: ExpressRouter = Express.getRouter();

Expand All @@ -39,6 +40,9 @@ router.get(
query: {
serverMonitorSecretKey: new ObjectID(monitorSecretKeyAsString),
monitorType: MonitorType.Server,
project: {
...ProjectService.getActiveProjectStatusQuery(),
},
},
select: {
_id: true,
Expand Down Expand Up @@ -78,6 +82,10 @@ router.post(
query: {
serverMonitorSecretKey: new ObjectID(monitorSecretKeyAsString),
monitorType: MonitorType.Server,
...MonitorService.getEnabledMonitorQuery(),
project: {
...ProjectService.getActiveProjectStatusQuery(),
},
},
select: {
_id: true,
Expand Down
5 changes: 5 additions & 0 deletions Worker/Jobs/ServerMonitor/CheckOnlineStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import QueryHelper from "Common/Server/Types/Database/QueryHelper";
import logger from "Common/Server/Utils/Logger";
import MonitorResourceUtil from "Common/Server/Utils/Monitor/MonitorResource";
import Monitor from "Common/Models/DatabaseModels/Monitor";
import ProjectService from "Common/Server/Services/ProjectService";

RunCron(
"ServerMonitor:CheckOnlineStatus",
Expand All @@ -23,6 +24,10 @@ RunCron(
monitorType: MonitorType.Server,
serverMonitorRequestReceivedAt:
QueryHelper.lessThanEqualToOrNull(threeMinsAgo),
...MonitorService.getEnabledMonitorQuery(),
project: {
...ProjectService.getActiveProjectStatusQuery(),
},
},
props: {
isRoot: true,
Expand Down

0 comments on commit e14c54c

Please sign in to comment.