From 9aa778e44e42dcac8e50cb9ddcc0bf00d0f2a867 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sun, 6 Aug 2023 13:47:38 +0900 Subject: [PATCH] reboot unfurler periodically --- unfurler/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unfurler/src/index.ts b/unfurler/src/index.ts index de13215e4..de4cef029 100644 --- a/unfurler/src/index.ts +++ b/unfurler/src/index.ts @@ -50,6 +50,12 @@ class Server { this.canonicalHost = canonical; this.startServer(); + + setTimeout(async () => { + logger.info(`killing myself now`); + await this.stopServer(); + process.exit(0); + }, 3600_000 * (1 + Math.random())) } async startServer() {