diff --git a/api/sample.env b/api/sample.env index 74df93d3fea..4c1b853deee 100644 --- a/api/sample.env +++ b/api/sample.env @@ -40,6 +40,15 @@ REDIS_URL=redis://localhost:6379 # default: none # sample (everyday at 06:30 UTC): CACHE_RELOAD_TIME=30 6 * * * +# Cache reload container size +# +# If not present, a default size is chosen by Scalingo +# +# present: optional +# type: string (S,M,L,XL,2XL) +# default: none +# CACHE_RELOAD_CONTAINER_SIZE=M + # ========= # DATABASES # ========= diff --git a/api/scripts/generate-cron.js b/api/scripts/generate-cron.js index 144045c83b6..73fe0a1f588 100644 --- a/api/scripts/generate-cron.js +++ b/api/scripts/generate-cron.js @@ -3,8 +3,13 @@ const cronContent = { }; if (process.env.CACHE_RELOAD_TIME) { - cronContent.jobs.push({ + const cacheReloadJob = { command: `${process.env.CACHE_RELOAD_TIME} npm run cache:refresh`, - }); + }; + if (process.env.CACHE_RELOAD_CONTAINER_SIZE) { + cacheReloadJob.size = process.env.CACHE_RELOAD_CONTAINER_SIZE; + } + cronContent.jobs.push(cacheReloadJob); } + console.log(JSON.stringify(cronContent));