🐛 oo-connector: do not crash if getting a health request before onlyoffice awake

This commit is contained in:
Eric Doughty-Papassideris
2024-10-03 00:38:15 +02:00
parent d24f0160c3
commit 0e516fa1b4
@@ -28,14 +28,18 @@ class ForgottenProcessor implements IHealthProvider {
} }
public async getHealthData() { public async getHealthData() {
const keys = await onlyofficeService.getForgottenList(); try {
return { const keys = await onlyofficeService.getForgottenList();
forgotten: { return {
timeSinceLastStartS: this.lastStart ? ~~((new Date().getTime() - this.lastStart) / 1000) : -1, forgotten: {
count: keys?.length ?? 0, timeSinceLastStartS: this.lastStart ? ~~((new Date().getTime() - this.lastStart) / 1000) : -1,
locks: this.forgottenSynchroniser.getWorstStats(), count: keys?.length ?? 0,
}, locks: this.forgottenSynchroniser.getWorstStats(),
}; },
};
} catch (e) {
return { forgotten: 'Error' };
}
} }
/** /**