Skip to content

Commit

Permalink
worker: use native celery worker in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yomguy committed Oct 13, 2020
1 parent 915a305 commit b3a726a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion app/bin/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
SCRIPT_DIR="$(dirname "$0")"
source "$SCRIPT_DIR/app_base.sh"

python3 manage.py timeside-celery-worker --loglevel $log_level --logfile $worker_log_file --uid $uid --gid $gid
# fix celery log access
mkdir -p '/var/log/celery/'
chown -R $uid:$gid '/var/log/celery/'

if [ $DEBUG = True ]; then
python3 manage.py timeside-celery-worker --loglevel $log_level --logfile $worker_log_file --uid $uid --gid $gid
else
celery -A worker worker --loglevel=$loglevel --logfile=$worker_log_file --uid=$uid --gid=$gid
fi

3 changes: 1 addition & 2 deletions timeside/server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,7 @@ def get(self, request, *args, **kwargs):
if result.hdf5:
container.from_hdf5(result.hdf5.path)
else:

return HttpResponse(container.to_json(),
return HttpResponse(container.to_json(),
content_type='application/json')


Expand Down

0 comments on commit b3a726a

Please sign in to comment.