Procházet zdrojové kódy

[Bugfix] Use fetchall()

Foppe Hemminga před 5 roky
rodič
revize
f1ddb96cb1
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  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)