Skip to content

Commit 8ce049e

Browse files
committed
fix(api_loader): If the collection is gone, there is no work to do
1 parent b5352b3 commit 8ce049e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

process/management/commands/api_loader.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def callback(client_state, channel, method, properties, input_message):
3030
url = input_message["url"]
3131
path = input_message["path"]
3232

33-
collection = Collection.objects.get(pk=collection_id)
33+
try:
34+
collection = Collection.objects.get(pk=collection_id)
35+
except Collection.DoesNotExist:
36+
ack(client_state, channel, method.delivery_tag)
37+
return
3438
if collection.deleted_at:
3539
ack(client_state, channel, method.delivery_tag)
3640
return

process/management/commands/finisher.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def callback(client_state, channel, method, properties, input_message):
4848
except Collection.DoesNotExist:
4949
ack(client_state, channel, method.delivery_tag)
5050
return
51-
5251
if collection.deleted_at:
5352
ack(client_state, channel, method.delivery_tag)
5453
return

0 commit comments

Comments
 (0)