added timer to import
This commit is contained in:
parent
5467aeeb0a
commit
e847d27809
6
main.py
6
main.py
@ -38,6 +38,7 @@ def import2sql():
|
|||||||
conn = sqlite3.connect('app.db')
|
conn = sqlite3.connect('app.db')
|
||||||
list = []
|
list = []
|
||||||
|
|
||||||
|
start_time = timeit.default_timer()
|
||||||
for root, dirs, files in os.walk(os.path.abspath(config.CONTENT_BASE_DIR)):
|
for root, dirs, files in os.walk(os.path.abspath(config.CONTENT_BASE_DIR)):
|
||||||
for file in files:
|
for file in files:
|
||||||
f = os.path.join(root, file)
|
f = os.path.join(root, file)
|
||||||
@ -63,7 +64,10 @@ def import2sql():
|
|||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
return "yay"
|
elapsed = timeit.default_timer() - start_time
|
||||||
|
print(elapsed)
|
||||||
|
|
||||||
|
return str(elapsed)
|
||||||
|
|
||||||
@app.route("/content/<path:path>")
|
@app.route("/content/<path:path>")
|
||||||
@auth.login_required
|
@auth.login_required
|
||||||
|
Loading…
Reference in New Issue
Block a user