Browse Source

[Bugfix] Use fetchall()

Foppe Hemminga 5 năm trước cách đây
mục cha
commit
f1ddb96cb1
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      cron.py

+ 3 - 1
cron.py

@@ -89,7 +89,8 @@ def cron():
         retrieved_properties = []
         for property in properties:
             pprint((row['maintainer'], row['player'], property,))
-            p_rows = cur.execute(query_second, (row['maintainer'], row['player'], property,))
+            cur.execute(query_second, (row['maintainer'], row['player'], property,))
+            p_rows = cur.fetchall()
             for p_row in p_rows:
                 # print(f"property: '{property}' parent: '{p_row['parent']}' -> value: '{p_row['value']}'")
                 retrieved_properties.append(property)
@@ -104,6 +105,7 @@ def cron():
                     update_value(row['maintainer'], row['player'], property, new_value)
             new_properties = []
             print(f"len(properties): {len(properties)}")
+            print(f"len(retieved_properties): {len(retieved_properties)}")
             for item in properties:
                 if item not in retrieved_properties:
                     new_properties.append(item)