From 475ef1c7bfd7cb0fa8de2b42e028133330f4e848 Mon Sep 17 00:00:00 2001 From: Brad Brown Date: Tue, 7 Jun 2022 10:32:50 -0500 Subject: [PATCH] better bulk update --- wordlinator/db/pg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wordlinator/db/pg.py b/wordlinator/db/pg.py index 03e6d75..bf0c0f8 100644 --- a/wordlinator/db/pg.py +++ b/wordlinator/db/pg.py @@ -124,4 +124,5 @@ class WordleDb: def bulk_update_scores(self, scores: typing.List[Score]): with db.atomic(): - Score.bulk_update(scores, fields=[Score.score], batch_size=50) + for score in scores: + score.save()