We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaf5fad commit 3bdce28Copy full SHA for 3bdce28
catalog/dags/flickr_thumbs_removal.py
@@ -43,21 +43,25 @@ def count():
43
44
@task()
45
def delete(num_thumbs):
46
+ log_sql = True
47
if num_thumbs == 0:
48
logger.info("No Flickr thumbnails found.")
49
50
while num_thumbs > 0:
51
query = dedent(
52
f"""
- UPDATE image SET thumbnail = NULL WHERE identifier IN
53
- (SELECT identifier {select_conditions} FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED)
+ UPDATE image SET thumbnail = NULL WHERE identifier IN (
54
+ SELECT identifier {select_conditions}
55
+ FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED
56
+ )
57
"""
58
)
- pg.run(query)
59
+ pg.run(query, log_sql=log_sql)
60
num_thumbs -= 10000
61
logger.info(
62
f"Flickr thumbnails left: {num_thumbs if num_thumbs > 0 else 0}."
63
64
+ log_sql = False
65
66
67
def report():
0 commit comments