This commit is contained in:
gauthiier 2022-07-31 17:13:00 +02:00
parent f6dc4264cf
commit 618d212358
2 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
from www import app
import logging
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
app.run(debug=True, use_reloader=False)
app.run(debug=True, use_reloader=False)

View File

@ -3,7 +3,7 @@ from www import app
import archive.archive as archive
import config
from datetime import datetime
import os, logging
import os, logging, time
lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password'])
@ -46,7 +46,7 @@ def searh():
if f_arg not in ['content', 'from']:
return "field '" + f_arg + "' does not exist"
print("annalen /search k_arg=" + k_arg + " l_arg=" + l_arg + " f_arg=" + f_arg)
logging.info("/search k_arg=" + k_arg + " l_arg=" + l_arg + " f_arg=" + f_arg)
lists = []
if l_arg == "all":
@ -54,9 +54,6 @@ def searh():
else:
lists.append(l_arg)
print(lists)
################################
##
## need to cache all the below.....
@ -67,6 +64,7 @@ def searh():
logging.info("search keyword = " + k_arg)
for l in lists:
with archive.Archive(l, config=config.db) as a:
@ -98,6 +96,8 @@ def searh():
sorted_results = sorted(results, key=get_result_key)
return jsonify(result=sorted_results)