From 422e80c05e00bb08f9b5b024c4d1c2b65ed1d072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20G=C3=A1lvez?= <72770565+sgalvezortiz@users.noreply.github.com> Date: Wed, 30 Mar 2022 12:18:26 -0300 Subject: [PATCH 1/2] Minor fix for clean uploaded PDFs. --- Dockerfile | 1 + clean_uploaded_pdfs.py | 4 ++-- crontab | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6698f06..f31c5fc 100755 --- a/Dockerfile +++ b/Dockerfile @@ -58,6 +58,7 @@ RUN mkdir -p /var/lib/deploy/robotreviewer/data ADD server.py /var/lib/deploy/ ADD server_api.py /var/lib/deploy/ ADD entrypoint.sh /var/lib/deploy/ +ADD clean_uploaded_pdfs.py /var/lib/deploy/ ADD crontab /etc/cron.d/crontab ADD robotreviewer /var/lib/deploy/robotreviewer RUN chown -R deploy.deploy /var/lib/deploy/robotreviewer diff --git a/clean_uploaded_pdfs.py b/clean_uploaded_pdfs.py index 028dda5..314dece 100644 --- a/clean_uploaded_pdfs.py +++ b/clean_uploaded_pdfs.py @@ -22,8 +22,8 @@ def cleanup_database(days=1): c = conn.cursor() c.execute("DELETE FROM article WHERE timestamp < datetime(?) AND dont_delete=0", [d]) conn.commit() - conn.execute("VACUUM") # make the database smaller again - conn.commit() + # conn.execute("VACUUM") # make the database smaller again + # conn.commit() conn.close() diff --git a/crontab b/crontab index 2ac9298..a9e16c0 100644 --- a/crontab +++ b/crontab @@ -1 +1 @@ -0 */12 * * * . /var/lib/deploy/cron.env && /var/lib/deploy/miniconda3/envs/robotreviewer/bin/python /var/lib/deploy/clean_uploaded_pdfs.py > /proc/1/fd/1 2>/proc/1/fd/2 +0 3 * * * . /var/lib/deploy/cron.env && /var/lib/deploy/miniconda3/envs/robotreviewer/bin/python /var/lib/deploy/clean_uploaded_pdfs.py > /proc/1/fd/1 2>/proc/1/fd/2 From 8d715d0dfb372d62f84eb1b53c565f6031cfab64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20G=C3=A1lvez?= <72770565+sgalvezortiz@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:22:09 -0300 Subject: [PATCH 2/2] Removed exposed ports at docker-compose.gpu.yml --- docker-compose.gpu.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docker-compose.gpu.yml b/docker-compose.gpu.yml index 86b064a..cf77087 100644 --- a/docker-compose.gpu.yml +++ b/docker-compose.gpu.yml @@ -16,8 +16,7 @@ services: target: /var/lib/deploy/config.json restart: unless-stopped command: web - ports: - - 5050:5000 + depends_on: - celery @@ -35,8 +34,7 @@ services: target: /var/lib/deploy/config.json restart: unless-stopped command: api - ports: - - 5051:5001 + depends_on: - celery