|
@@ -124,6 +124,7 @@ def main():
|
|
|
elif action == 'index-files':
|
|
elif action == 'index-files':
|
|
|
counter = 0
|
|
counter = 0
|
|
|
already_indexed = 0
|
|
already_indexed = 0
|
|
|
|
|
+ multiplo_commit = 200
|
|
|
conn = sqlite3.connect(dbpath)
|
|
conn = sqlite3.connect(dbpath)
|
|
|
path = os.path.join('/var/fourier', device_id)
|
|
path = os.path.join('/var/fourier', device_id)
|
|
|
if args.station:
|
|
if args.station:
|
|
@@ -159,6 +160,10 @@ def main():
|
|
|
counter += 1
|
|
counter += 1
|
|
|
print(dt)
|
|
print(dt)
|
|
|
|
|
|
|
|
|
|
+ if counter % multiplo_commit == 0:
|
|
|
|
|
+ conn.commit()
|
|
|
|
|
+ print('commited')
|
|
|
|
|
+
|
|
|
except sqlite3.IntegrityError:
|
|
except sqlite3.IntegrityError:
|
|
|
already_indexed += 1
|
|
already_indexed += 1
|
|
|
print('already indexed: {}'.format(filename))
|
|
print('already indexed: {}'.format(filename))
|