Skip to content

Commit

Permalink
feat: override task quotas from secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
jschuur committed Jan 23, 2024
1 parent 7e70c62 commit 1be9643
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
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 }"
2 changes: 2 additions & 0 deletions apps/backend/src/findVideos.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,6 @@ async function findNewVideos(channels) {

logTimeSpent(startTime);
logMemoryUsage();

process.exit(0);
})();
1 change: 1 addition & 0 deletions packages/config/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 1be9643

Please sign in to comment.