Skip to content

Commit 83e8aa1

Browse files
committed
[gh-17] added a comment explaining the script change
1 parent 0f94601 commit 83e8aa1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

edrop-cron.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,21 @@ export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
1515
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
1616
mkdir -p /edrop/logs
1717

18+
# When a new container is being created, eDROP Connector takes a long time to startup because all dependencies
19+
# need to be installed first. The cron job, however, needs all dependencies to be installed before it can start up.
20+
# Since we know that once eDROP Connector is up and running, all dependencies are installed, we just wait till we
21+
# get a 200 response from the web app before starting the cron job.
22+
# Using the autorestart property of Supervisor does not seem to work when deployed in production, hence this work around.
1823
while true; do
1924
sleep 5;
2025
http_response=$(curl -s -o /dev/null -I -w "%{http_code}\n" http://localhost:8000/$APP_ROOT);
2126
if [ $http_response == "200" ]; then
2227
break
2328
else
24-
echo "eDrop not responding"
29+
echo "eDROP Connector is not yet responding."
2530
fi
2631
done
27-
echo "eDrop has started successfully"
32+
echo "eDROP Connector has started successfully"
2833

2934
# start the cron job
3035
python manage.py runapscheduler

0 commit comments

Comments
 (0)