Update libs; Removed support PostgreSQL 13
This commit is contained in:
8
start.py
8
start.py
@@ -64,9 +64,7 @@ def backup_db_from_postgres(file_path: str) -> bool:
|
||||
:param file:
|
||||
:return:
|
||||
"""
|
||||
postgres_connection_url = (
|
||||
f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}"
|
||||
)
|
||||
postgres_connection_url = f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}"
|
||||
try:
|
||||
process = subprocess.Popen(
|
||||
[
|
||||
@@ -91,9 +89,7 @@ def backup_db_from_postgres(file_path: str) -> bool:
|
||||
def compress_file_to_xz(file_path: str) -> str:
|
||||
compressed_file_path = f"{file_path}.xz"
|
||||
with open(file_path, "rb") as origin_file:
|
||||
with lzma.open(
|
||||
compressed_file_path, "wb", filters=COMPRESSION_SETTINGS
|
||||
) as compressed_file:
|
||||
with lzma.open(compressed_file_path, "wb", filters=COMPRESSION_SETTINGS) as compressed_file:
|
||||
shutil.copyfileobj(origin_file, compressed_file)
|
||||
os.remove(file_path)
|
||||
return compressed_file_path
|
||||
|
||||
Reference in New Issue
Block a user