From b413b8468981cc4b1ff225702bece8f2bb976376 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Thu, 24 Oct 2024 00:18:10 -0700 Subject: [PATCH] Restart every hour w/ reduced cache size --- backend/api/ecosystem.config.js | 4 ++-- backend/shared/src/init-caches.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/api/ecosystem.config.js b/backend/api/ecosystem.config.js index 776cb1b193..ddb80569df 100644 --- a/backend/api/ecosystem.config.js +++ b/backend/api/ecosystem.config.js @@ -3,8 +3,8 @@ module.exports = { { name: 'serve', script: 'backend/api/lib/serve.js', - // Restart every day at 2/3 AM LA time (UTC-7/8) - cron_restart: '0 10 * * *', + // Restart every hour + cron_restart: '0 * * * *', instances: 1, autorestart: true, watch: false, diff --git a/backend/shared/src/init-caches.ts b/backend/shared/src/init-caches.ts index eee57f3eef..f9c7df7347 100644 --- a/backend/shared/src/init-caches.ts +++ b/backend/shared/src/init-caches.ts @@ -13,7 +13,7 @@ export const initCaches = async (timeoutId: NodeJS.Timeout) => { const activeUserIdsToCacheInterests = await pg.map( `select distinct user_id from user_contract_interactions where created_time > now() - interval $1`, - ['1 month'], + ['1 hour'], (r) => r.user_id as string ) clearTimeout(timeoutId)