Don't try and update an empty list of URLs

This commit is contained in:
Daoud Clarke 2023-01-09 21:02:40 +00:00
parent d347a17d63
commit bd0cc3863e

View file

@ -59,6 +59,9 @@ class IndexDatabase:
return [BatchInfo(url, user_id_hash, status) for url, user_id_hash, status in results]
def update_batch_status(self, batch_urls: list[str], status: BatchStatus):
if not batch_urls:
return
sql = """
UPDATE batches SET status = %(status)s
WHERE url IN %(urls)s