Commit a57fd5d5 authored by Konstantin Schulz's avatar Konstantin Schulz

introduce detailed logging for every database action

parent 516734c9
Pipeline #11601 passed with stages
in 3 minutes and 46 seconds
...@@ -16,6 +16,7 @@ def get(last_update_time: int) -> Union[Response, ConnexionResponse]: ...@@ -16,6 +16,7 @@ def get(last_update_time: int) -> Union[Response, ConnexionResponse]:
ui_cts: UpdateInfo ui_cts: UpdateInfo
try: try:
ui_cts = db.session.query(UpdateInfo).filter_by(resource_type=ResourceType.cts_data.name).first() ui_cts = db.session.query(UpdateInfo).filter_by(resource_type=ResourceType.cts_data.name).first()
db.session.commit()
except (InvalidRequestError, OperationalError): except (InvalidRequestError, OperationalError):
db.session.rollback() db.session.rollback()
return NetworkService.make_json_response(None) return NetworkService.make_json_response(None)
......
...@@ -20,6 +20,7 @@ class DatabaseService: ...@@ -20,6 +20,7 @@ class DatabaseService:
def check_corpus_list_age(app: Flask) -> None: def check_corpus_list_age(app: Flask) -> None:
""" Checks whether the corpus list needs to be updated. If yes, it performs the update. """ """ Checks whether the corpus list needs to be updated. If yes, it performs the update. """
ui_cts: UpdateInfo = db.session.query(UpdateInfo).filter_by(resource_type=ResourceType.cts_data.name).first() ui_cts: UpdateInfo = db.session.query(UpdateInfo).filter_by(resource_type=ResourceType.cts_data.name).first()
db.session.commit()
if ui_cts is None: if ui_cts is None:
return return
else: else:
......
...@@ -127,6 +127,7 @@ class Config(object): ...@@ -127,6 +127,7 @@ class Config(object):
SERVER_URI_VOCABULARY = SERVER_URI_BASE + "vocabulary" SERVER_URI_VOCABULARY = SERVER_URI_BASE + "vocabulary"
# END endpoints # END endpoints
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") or DATABASE_URL_SQLITE SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") or DATABASE_URL_SQLITE
SQLALCHEMY_ECHO = True
SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_TRACK_MODIFICATIONS = False
STATIC_EXERCISES_REPOSITORY_URL = "https://scm.cms.hu-berlin.de/callidus/machina-callida/-/archive/master/machina-callida-master.zip?path=mc_frontend%2Fsrc%2Fassets%2Fh5p" STATIC_EXERCISES_REPOSITORY_URL = "https://scm.cms.hu-berlin.de/callidus/machina-callida/-/archive/master/machina-callida-master.zip?path=mc_frontend%2Fsrc%2Fassets%2Fh5p"
STOP_WORDS_LATIN_PATH = os.path.join(CACHE_DIRECTORY, "stop_words_latin.json") STOP_WORDS_LATIN_PATH = os.path.join(CACHE_DIRECTORY, "stop_words_latin.json")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment