This commit is contained in:
Administrator
2022-05-08 19:59:06 +00:00
parent 210d87efdf
commit f81029b211
7 changed files with 194 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ from tempfile import TemporaryDirectory
from Main.models.progress import Progress
from Sprint.settings import CONSTS
from SprintLib.queue import notify
from SprintLib.queue import notify, send_to_queue
from SprintLib.utils import Timer
@@ -132,6 +132,14 @@ class BaseTester:
def cleanup(self):
self.solution.save()
send_to_queue("redis", {"action": "docker", "key": "containers", "value": f"solution_{self.solution.id}"})
if self.checker_code:
send_to_queue("redis", {"action": "docker", "key": "containers", "value": f"solution_{self.solution.id}_checker"})
for file in self.solution.task.dockerfiles:
add_name = file.filename[11:]
send_to_queue("redis", {"action": "docker", "key": "containers", "value": f"solution_container_{self.solution.id}_{add_name}"})
send_to_queue("redis", {"action": "docker", "key": "images", "value": f"solution_image_{self.solution.id}_{add_name}"})
send_to_queue("redis", {"action": "docker", "key": "networks", "value": f"solution_network_{self.solution.id}"})
def save_progress(self):
progress = Progress.objects.get(