diff --git a/functions.py b/functions.py index f598afa..07f769a 100644 --- a/functions.py +++ b/functions.py @@ -698,7 +698,7 @@ def createExport() -> dict: # Export database to SQL file dump_file = temp_dir / 'database.sql' result = subprocess.Popen( - f'pg_dump -U {dbUser} -d {dbName} -F c -E UTF8 -f {dump_file}', + f'pg_dump -h {dbHost} -U {dbUser} -d {dbName} -F c -E UTF8 -f {dump_file}', stdin=subprocess.PIPE, shell=True, stdout=subprocess.PIPE, @@ -706,6 +706,7 @@ def createExport() -> dict: encoding="utf-8", env=dict(os.environ, PGPASSWORD=dbPass) ) + # absolutely dumb workaround for an error time.sleep(1) @@ -771,7 +772,7 @@ def importData(export_file) -> dict: dump_file = const.tempDir / 'database.sql' process = subprocess.Popen( - f'pg_restore --clean -U {dbUser} -d {dbName} {dump_file}', + f'pg_restore -h {dbHost} --clean -U {dbUser} -d {dbName} {dump_file}', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,