Skip to content

Commit 4e217ef

Browse files
committed
feat: ensure supercronic only loads the crontab once when the entrypoint is called multiple times during startup
1 parent 101652f commit 4e217ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pact_broker/entrypoint.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/sh
22

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

0 commit comments

Comments
 (0)