Skip to content

Commit

Permalink
🐛 oo-connector: do not crash if getting a health request before onlyo…
Browse files Browse the repository at this point in the history
…ffice awake
  • Loading branch information
ericlinagora committed Oct 3, 2024
1 parent d24f016 commit 0e516fa
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ class ForgottenProcessor implements IHealthProvider {
}

public async getHealthData() {
const keys = await onlyofficeService.getForgottenList();
return {
forgotten: {
timeSinceLastStartS: this.lastStart ? ~~((new Date().getTime() - this.lastStart) / 1000) : -1,
count: keys?.length ?? 0,
locks: this.forgottenSynchroniser.getWorstStats(),
},
};
try {
const keys = await onlyofficeService.getForgottenList();
return {
forgotten: {
timeSinceLastStartS: this.lastStart ? ~~((new Date().getTime() - this.lastStart) / 1000) : -1,
count: keys?.length ?? 0,
locks: this.forgottenSynchroniser.getWorstStats(),
},
};
} catch (e) {
return { forgotten: 'Error' };
}
}

/**
Expand Down

0 comments on commit 0e516fa

Please sign in to comment.