forked from microsoft/aerial_wildlife_detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch_celery.sh
executable file
·29 lines (25 loc) · 965 Bytes
/
launch_celery.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Launches a Celery consumer on the current machine.
# Requires pwd to be the root of the project and the correct Python
# env to be loaded.
#
# 2019-20 Benjamin Kellenberger
launchCeleryBeat=false
IFS=',' read -ra ADDR <<< "$AIDE_MODULES"
for i in "${ADDR[@]}"; do
module="$(echo "$i" | tr '[:upper:]' '[:lower:]')";
if [ "$module" == "fileserver" ]; then
folderWatchInterval=$(python util/configDef.py --section=FileServer --parameter=watch_folder_interval --fallback=60);
if [[ $folderWatchInterval -gt 0 ]]; then
launchCeleryBeat=true;
fi
fi
done
if [ $launchCeleryBeat ]; then
# folder watching interval specified; enable Celery beat
tempDir="$(python util/configDef.py --section=FileServer --parameter=tempfiles_dir --fallback=/tmp/aide)";
mkdir -p $tempDir;
celery -A celery_worker worker -B -s $tempDir --hostname aide@%h
else
celery -A celery_worker worker --hostname aide@%h
fi