-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrunserver
executable file
·55 lines (52 loc) · 1.43 KB
/
runserver
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash -ex
/wait
if [[ $NOMAD_ALLOC_INDEX == "0" ]]; then
(
set +e
while true; do
sleep 60
./manage.py syncnextclouddirs
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Syncing nextcloud directories wasn't successful. Sleeping for 30 minutes..."
sleep 1800
fi
done
) &
(
set +e
while true; do
sleep 3600
./manage.py purgenextclouddirs
done
) &
fi
if [[ "$DEBUG" == "true" ]]; then
# --max-requests 1 \ # poor man's autoreload
exec gunicorn --reload \
--preload \
--access-logfile '-' \
--error-logfile '-' \
--log-level 'info' \
--worker-class $GUNICORN_WORKER_CLASS \
--workers $GUNICORN_WORKERS \
--threads $GUNICORN_THREADS \
--max-requests $GUNICORN_MAX_REQUESTS \
--keep-alive 120 \
--timeout 600 \
--graceful-timeout 300 \
-b 0.0.0.0:8000 \
hoover.site.wsgi:application
else
exec gunicorn \
--error-logfile '-' \
--worker-class $GUNICORN_WORKER_CLASS \
--workers $GUNICORN_WORKERS \
--threads $GUNICORN_THREADS \
--max-requests $GUNICORN_MAX_REQUESTS \
--keep-alive 120 \
--timeout 600 \
--graceful-timeout 300 \
-b 0.0.0.0:8000 \
hoover.site.wsgi:application
fi