fixed type error
This commit is contained in:
parent
0d4e6c6f80
commit
67b41fb91a
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -120,7 +120,7 @@ const check = async () => {
|
|||
for (const service of config.services) {
|
||||
const oldStatus = cache[service.id];
|
||||
const newStatus = await checkService(service, oldStatus);
|
||||
if (oldStatus.status !== newStatus.status) {
|
||||
if (!oldStatus || oldStatus.status !== newStatus.status) {
|
||||
console.log(service.id + ' status changed: ' + newStatus.status);
|
||||
await pushStatusToCachet(service.id, newStatus.status);
|
||||
cache[service.id] = newStatus;
|
||||
|
|
Reference in a new issue