Skip to content

Commit

Permalink
use filelogger for celery and nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
DerouineauNicolas committed Jul 5, 2024
1 parent fccf87e commit d63e98a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ HIGH_LAYER_QUALITY=3
#Set LOW_QUALITY_LAYER_BITRATE to 0 if you only want one layer (highest quality) output.
LOW_QUALITY_LAYER_BITRATE=400000
X264_SETTINGS=medium
#If True, subprocess output will be dumped to log files (very verbose, use with care)
SUBPROCESS_VERBOSE_OUTPUT=False

#Number of gunicorn worker (should be set accordingly to your hardware)
NUM_GUNICORN_WORKER=4
#If a tmdb API token is provided, Movies/Tv show cover will be downloaded from there.
Expand Down
1 change: 0 additions & 1 deletion backend/StreamServerApp/views/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
class Task(APIView):

def get(self, request, task_id):
logger.debug("task id = {} ".format(task_id))
state = result.AsyncResult(task_id).state
return JsonResponse(status=200, data={'state': str(state)})
7 changes: 3 additions & 4 deletions backend/start_celery_workers.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mkdir -p $HOME/run/celery/
mkdir -p $HOME/log/celery/
touch "$HOME/log/celery/test.log"
mkdir -p /debug/celery/
rm "$HOME/run/celery/*.pid"
celery multi start 2 -A StreamingServer -B:2 -Q:2 cpu_extensive -c:2 1 --pidfile="$HOME/run/celery/%n.pid" --logfile="$HOME/log/celery/test.log"
tail -f "$HOME/log/celery/test.log"
celery multi start 2 -A StreamingServer -B:2 -Q:2 cpu_extensive -c:2 1 --pidfile="$HOME/run/celery/%n.pid" --logfile="/debug/celery/celery.log"
sleep infinity
1 change: 1 addition & 0 deletions docker-compose-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ services:
- static_volume:/usr/static/
- torrent:/usr/torrent/:rw
- secrets_volume:/secrets/
- ./log/:/debug/
ports:
- 1337:80
depends_on:
Expand Down
1 change: 1 addition & 0 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ services:
- static_volume:/usr/static/
- torrent:/usr/torrent/:rw
- secrets_volume:/secrets/
- ./log/:/debug/
ports:
- 1337:80
depends_on:
Expand Down
3 changes: 3 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ server {

client_max_body_size 0;

access_log /debug/nginx-access.log;
error_log /debug/nginx-error.log;

location /admin/ {

proxy_set_header 'Access-Control-Allow-Origin' '*';
Expand Down

0 comments on commit d63e98a

Please sign in to comment.