From 1be964362e7a2de347e87858732f6a8601198aaa Mon Sep 17 00:00:00 2001 From: Joost Schuur Date: Tue, 23 Jan 2024 10:55:46 +0000 Subject: [PATCH] feat: override task quotas from secrets --- .env.sample | 5 ++++- apps/backend/src/findVideos.js | 2 ++ packages/config/src/index.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index a66607f..49883d7 100644 --- a/.env.sample +++ b/.env.sample @@ -4,4 +4,7 @@ REVALIDATE_SECRET_TOKEN="" NEXT_PUBLIC_GOOGLE_ANALYTICS="" NEXT_PUBLIC_SENTRY_DSN="" # Set to http://localhost:3000 when running locally for home page update. Otherwise defauts to https://learnbyvideo.dev -SITE_BASE_URL="" \ No newline at end of file +SITE_BASE_URL="" +UPDATE_HOSTNAMES="" +# Override the default task quotas (new items are merged into the existing quotas) +# TASK_QUOTAS="{ "all": 10000, "crawl_channels": 2000, "find_videos": 4000, "update_video": 5000, "update_channels": 500, "add_channel": 2000 }" \ No newline at end of file diff --git a/apps/backend/src/findVideos.js b/apps/backend/src/findVideos.js index 062e1e5..69b758c 100644 --- a/apps/backend/src/findVideos.js +++ b/apps/backend/src/findVideos.js @@ -170,4 +170,6 @@ async function findNewVideos(channels) { logTimeSpent(startTime); logMemoryUsage(); + + process.exit(0); })(); diff --git a/packages/config/src/index.js b/packages/config/src/index.js index 6832887..b42e4ff 100644 --- a/packages/config/src/index.js +++ b/packages/config/src/index.js @@ -25,6 +25,7 @@ const config = { update_videos: 5000, update_channels: 500, add_channel: 2000, + ...(process.env.TASK_QUOTAS ? JSON.parse(process.env.TASK_QUOTAS) : {}), }, youTubeApiPartQuotas: {