Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit 7ee7e78

Browse files
committed
Fix: Correct logging destinations.
Correct Celery startup.
1 parent c4e5bde commit 7ee7e78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docker/docker_tools_misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ def _start_servers(dev: bool) -> None:
8787
# ``sudo`` doesn't pass root's env vars; provide only the env vars Celery needs when invoking it.
8888
xqt(
8989
'sudo -u www-data env "PATH=$PATH" "REDIS_URI=$REDIS_URI" '
90-
"poetry run celery --app=internal.scheduled_builder worker --pool=threads "
90+
"poetry run celery --app=bookserver.internal.scheduled_builder worker --pool=threads "
9191
"--concurrency=3 --loglevel=info "
9292
# Celery runs as the ``www-data`` user, so it doesn't have access to the root-owned log files (which are symbolic links to files owned by root -- changing permission doesn't work). Therefore, redirect output (as root) to make this work.
93-
"> /var/log/celery/access.log 2> /var/log/error.log &",
94-
cwd=f"{env.BOOK_SERVER_PATH}/bookserver",
93+
"> /var/log/celery/access.log 2> /var/log/celery/error.log &",
94+
cwd=env.RUNESTONE_PATH,
9595
)
9696

9797
xqt(
@@ -102,7 +102,7 @@ def _start_servers(dev: bool) -> None:
102102
# This much match the address in `./nginx/sites-available/runestone.template`.
103103
f"--bind unix:/run/fastapi.sock {'--reload ' if dev else ''} "
104104
# If logging to a file, then Gunicorn tries to append to it (open the file with a mode of "a+"). This fails if the underlying "file" is actually ``stdout`` or ``stderr`` with the error ``io.UnsupportedOperation: File or stream is not seekable.``. So, redirect these instead.
105-
"> /var/log/celery/access.log 2> /var/log/celery/error.log &",
105+
"> /var/log/gunicorn/access.log 2> /var/log/gunicorn/error.log &",
106106
"service nginx start",
107107
"poetry run gunicorn -D --config $RUNESTONE_PATH/docker/gunicorn_config/web2py_config.py &",
108108
cwd=f"{env.RUNESTONE_PATH}/docker/gunicorn_config",

0 commit comments

Comments
 (0)