From c47cc871d8d924f6afef8f176d204e69783372e7 Mon Sep 17 00:00:00 2001 From: Krystle Salazar Date: Mon, 5 Jun 2023 18:48:21 -0400 Subject: [PATCH] Add locking clause Co-authored-by: Staci Mullins <63313398+stacimc@users.noreply.github.com> --- catalog/dags/flickr_thumbs_removal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/dags/flickr_thumbs_removal.py b/catalog/dags/flickr_thumbs_removal.py index ab4921738dc..fabfc712d88 100644 --- a/catalog/dags/flickr_thumbs_removal.py +++ b/catalog/dags/flickr_thumbs_removal.py @@ -50,7 +50,7 @@ def delete(num_thumbs): query = dedent( f""" UPDATE image SET thumbnail = NULL WHERE identifier IN - (SELECT identifier {select_conditions} FETCH FIRST 10000 ROWS ONLY) + (SELECT identifier {select_conditions} FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED) """ ) pg.run(query)