From 60ee63aec5d6b4ceddeeeb21421d9a6714088093 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Tue, 13 Apr 2021 17:01:11 +0200 Subject: [PATCH] working on 0.0.28 Release --- src/covid19/blueprints/admin/admin_service.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/covid19/blueprints/admin/admin_service.py b/src/covid19/blueprints/admin/admin_service.py index c341fd24..1fe943d4 100644 --- a/src/covid19/blueprints/admin/admin_service.py +++ b/src/covid19/blueprints/admin/admin_service.py @@ -11,6 +11,7 @@ class AdminService: app.logger.debug("------------------------------------------------------------") self.__database = database self.limit_nr = 20 + self.file_path = '..'+os.sep+'data'+os.sep+'db'+os.sep+'covid19data.sql' app.logger.debug("------------------------------------------------------------") app.logger.info(" Admin Service [ready]") @@ -25,10 +26,10 @@ class AdminService: url = app.config['SQLALCHEMY_POSTGRES_URL'] db = app.config['SQLALCHEMY_POSTGRES_DB'] cmd = 'pg_dump -U '+user+' -h '+url+' '+db\ - +' --compress=9 --clean --if-exists --no-tablespaces '\ + +' --clean --if-exists --no-tablespaces '\ +' --on-conflict-do-nothing --rows-per-insert=200 --column-inserts '\ +' --quote-all-identifiers --no-privileges > '\ - + '..'+os.sep+'data'+os.sep+'db'+os.sep+'covid19data.sql.gz' + + self.file_path app.logger.info(" start: "+str(cmd)) returncode = self.__run_ome_shell_command(cmd) app.logger.info(" result: " + str(returncode)) @@ -57,11 +58,8 @@ class AdminService: user = app.config['SQLALCHEMY_POSTGRES_USER'] url = app.config['SQLALCHEMY_POSTGRES_URL'] db = app.config['SQLALCHEMY_POSTGRES_DB'] - file_path = '..' + os.sep + '..' + os.sep + 'data' + os.sep + 'db' + os.sep + 'covid19data.sql' cmd_list = [ - 'gunzip ' + file_path + '.gz', - 'pgsql -U ' + user + ' -h ' + url + ' ' + db + ' < ' + file_path, - 'gzip ' + file_path + 'pgsql -U ' + user + ' -h ' + url + ' ' + db + ' < ' + self.file_path ] for cmd in cmd_list: returncode = self.__run_ome_shell_command(cmd) -- GitLab