Bläddra i källkod

one cursor for update

Gamaliel Espinoza 8 år sedan
förälder
incheckning
151f3ee102
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      tools/fourier/cli.py

+ 2 - 2
tools/fourier/cli.py

@@ -210,8 +210,9 @@ def main():
 
             if args.limit:
                 query += ' limit {}'.format(args.limit)
-                
+
             cursor.execute(query)
+            curup = conn.cursor()
 
             for row in cursor:
                 the_hash, filename, = row
@@ -219,7 +220,6 @@ def main():
                 if match:
                     station_code = match.group(1)
                     params = station_code, the_hash,
-                    curup = conn.cursor()
                     curup.execute(('update "file" '
                                     'set "station" = ? '
                                     'where "hash" = ?'