diff options
| author | MohamedBassem <me@mbassem.com> | 2024-07-28 00:27:36 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-07-28 00:27:36 +0000 |
| commit | 92c92c161b3195bdfb571284e783f39f369a25a5 (patch) | |
| tree | 8304bfd920dd2e47dc5d76cc8d176785b660d524 /apps/workers/crawlerWorker.ts | |
| parent | c72dbd04e7b148120af721da27cd5ddd1b4eae82 (diff) | |
| download | karakeep-92c92c161b3195bdfb571284e783f39f369a25a5.tar.zst | |
fix(workers): Shutdown workers on SIGTERM
Diffstat (limited to 'apps/workers/crawlerWorker.ts')
| -rw-r--r-- | apps/workers/crawlerWorker.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/workers/crawlerWorker.ts b/apps/workers/crawlerWorker.ts index bb226a27..76348821 100644 --- a/apps/workers/crawlerWorker.ts +++ b/apps/workers/crawlerWorker.ts @@ -114,6 +114,10 @@ async function launchBrowser() { logger.error( "[Crawler] Failed to connect to the browser instance, will retry in 5 secs", ); + if (isShuttingDown) { + logger.info("[Crawler] We're shutting down so won't retry."); + return; + } setTimeout(() => { launchBrowser(); }, 5000); |
