removed transaction
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
from time import sleep
|
||||
|
||||
import pika
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
@@ -20,15 +18,10 @@ class Command(BaseCommand):
|
||||
channel.queue_declare(queue="test")
|
||||
|
||||
def callback(ch, method, properties, body):
|
||||
id = int(str(body, encoding="utf-8"))
|
||||
print(f"Received id {id}")
|
||||
solution = Solution.objects.get(id=id)
|
||||
try:
|
||||
id = int(str(body, encoding="utf-8"))
|
||||
print(f"Received id {id}")
|
||||
while True:
|
||||
try:
|
||||
solution = Solution.objects.get(id=id)
|
||||
break
|
||||
except:
|
||||
sleep(0.5)
|
||||
eval(solution.language.work_name + "Tester")(solution).execute()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
Reference in New Issue
Block a user