diff --git a/SprintLib/testers/BaseTester.py b/SprintLib/testers/BaseTester.py index 06e7fca..a50bd9b 100644 --- a/SprintLib/testers/BaseTester.py +++ b/SprintLib/testers/BaseTester.py @@ -109,7 +109,8 @@ class BaseTester: def cleanup(self): self.solution.save() send_to_queue("cleaner", {"type": "container", "name": f"solution_{self.solution.id}"}) - send_to_queue("cleaner", {"type": "container", "name": f"solution_{self.solution.id}_checker"}) + if self.checker_code: + send_to_queue("cleaner", {"type": "container", "name": f"solution_{self.solution.id}_checker"}) for file in self.solution.task.dockerfiles: add_name = file.filename[11:] send_to_queue("cleaner", {"type": "container", "name": f"solution_container_{self.solution.id}_{add_name}"}) diff --git a/daemons/management/commands/docker_cleaner.py b/daemons/management/commands/docker_cleaner.py index f9e2e7d..769d2a8 100644 --- a/daemons/management/commands/docker_cleaner.py +++ b/daemons/management/commands/docker_cleaner.py @@ -1,6 +1,6 @@ from subprocess import call -from SprintLib.queue import MessagingSupport +from SprintLib.queue import MessagingSupport, send_to_queue class Command(MessagingSupport): @@ -30,3 +30,4 @@ class Command(MessagingSupport): print(f"Removed {type} {name}") else: print("Something went wrong") + send_to_queue(self.queue_name, payload) diff --git a/docker-compose-deploy.yaml b/docker-compose-deploy.yaml index 1b475b5..3daf35f 100644 --- a/docker-compose-deploy.yaml +++ b/docker-compose-deploy.yaml @@ -258,8 +258,7 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock deploy: - mode: replicated - replicas: 1 + mode: global restart_policy: condition: any update_config: