diff --git a/SprintLib/queue.py b/SprintLib/queue.py index 8dc5d26..371f134 100644 --- a/SprintLib/queue.py +++ b/SprintLib/queue.py @@ -6,6 +6,7 @@ from django.db import transaction from django.core.exceptions import ObjectDoesNotExist from django.core.management import BaseCommand from django.utils import timezone +from django import db from pika.adapters.utils.connection_workflow import AMQPConnectorException from Main.models.outbox_message import OutboxMessage @@ -37,6 +38,7 @@ class MessagingSupport(BaseCommand): print("Message is not JSON decodable") return print(f"Got {data}, processing...") + db.close_old_connections() try: outbox_message = OutboxMessage.objects.get(id=data["id"]) except ObjectDoesNotExist: