Skip to content

Commit c47cc87

Browse files
krysalstacimc
andauthored
Add locking clause
Co-authored-by: Staci Mullins <63313398+stacimc@users.noreply.github.com>
1 parent 62aa408 commit c47cc87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

catalog/dags/flickr_thumbs_removal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def delete(num_thumbs):
5050
query = dedent(
5151
f"""
5252
UPDATE image SET thumbnail = NULL WHERE identifier IN
53-
(SELECT identifier {select_conditions} FETCH FIRST 10000 ROWS ONLY)
53+
(SELECT identifier {select_conditions} FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED)
5454
"""
5555
)
5656
pg.run(query)

0 commit comments

Comments
 (0)