From 47c28625844f48094ccde292b182acba52fed70a Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Wed, 27 Sep 2023 15:58:12 +0300 Subject: [PATCH] Remove the tmpdir with feedback and thumbnail after job is finished Otherwise get out of /tmp storage with long uptime. --- docker-app/worker_wrapper/wrapper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-app/worker_wrapper/wrapper.py b/docker-app/worker_wrapper/wrapper.py index 369e9f5a6..48ca4c315 100644 --- a/docker-app/worker_wrapper/wrapper.py +++ b/docker-app/worker_wrapper/wrapper.py @@ -1,6 +1,7 @@ import json import logging import os +import shutil import sys import tempfile import traceback @@ -223,6 +224,8 @@ def run(self): self.after_docker_run() + shutil.rmtree(str(self.shared_tempdir), ignore_errors=True) + self.job.finished_at = timezone.now() self.job.status = Job.Status.FINISHED self.job.save(update_fields=["status", "finished_at"])