Skip to content

Commit

Permalink
feat: ensure supercronic only loads the crontab once when the entrypo…
Browse files Browse the repository at this point in the history
…int is called multiple times during startup
  • Loading branch information
bethesque committed Dec 3, 2020
1 parent 101652f commit 4e217ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pact_broker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/sh

if [ "${PACT_BROKER_DATABASE_BETA_CLEAN_ENABLED}" = "true" ]; then
if [ "${PACT_BROKER_DATABASE_BETA_CLEAN_ENABLED}" = "true" ] && [ ! -f .supercronic ]; then
echo "Creating crontab with schedule ${PACT_BROKER_DATABASE_CLEAN_CRON_SCHEDULE} to clean database"
echo "${PACT_BROKER_DATABASE_CLEAN_CRON_SCHEDULE} /pact_broker/clean.sh" >> /pact_broker/crontab
touch .supercronic
/usr/local/bin/supercronic -quiet -passthrough-logs /pact_broker/crontab &
fi

Expand Down

0 comments on commit 4e217ef

Please sign in to comment.