register all cron jobs in entrypoint (#12791)
closes https://github.com/twentyhq/core-team-issues/issues/1113 Three things I am not sure about - - Should we have a variable just like DISABLE_DB_MIGRATIONS to control cron job registration behavior, i.e., DISABLE_CRON_JOBS_REGISTRATION? - The location of the command ie, folder placement - https://github.com/twentyhq/twenty/pull/12791/files#r2161734131
This commit is contained in:
@ -28,7 +28,23 @@ setup_and_migrate_db() {
|
||||
yarn command:prod upgrade
|
||||
echo "Successfully migrated DB!"
|
||||
}
|
||||
|
||||
register_background_jobs() {
|
||||
if [ "${DISABLE_CRON_JOBS_REGISTRATION}" = "true" ]; then
|
||||
echo "Cron job registration is disabled, skipping..."
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Registering background sync jobs..."
|
||||
if yarn command:prod cron:register:all; then
|
||||
echo "Successfully registered all background sync jobs!"
|
||||
else
|
||||
echo "Warning: Failed to register background jobs, but continuing startup..."
|
||||
fi
|
||||
}
|
||||
|
||||
setup_and_migrate_db
|
||||
register_background_jobs
|
||||
|
||||
# Continue with the original Docker command
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user