This commit is contained in:
Egor Matveev
2022-02-06 11:15:54 +03:00
parent fe6bf5df43
commit e4de414799
2 changed files with 9 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
from os.path import join, exists
from shutil import rmtree
import pika
from django.core.management.base import BaseCommand
@@ -27,6 +30,10 @@ class Command(BaseCommand):
print(e)
solution.result = "TE"
solution.save()
finally:
path = join("solutions", str(id))
if exists(path):
rmtree(path)
channel.basic_consume(queue="test", on_message_callback=callback, auto_ack=True)
channel.start_consuming()