Skip to content

Commit

Permalink
fix(pg-dd): double compressed files
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalenic committed Nov 26, 2024
1 parent c2a8bdb commit ae393eb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/workload/stateless/stacks/pg-dd/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PG_DD_URL=postgresql://orcabus:[email protected]:5432# pragma: allowlist secret
PG_DD_URL=postgresql://orcabus:[email protected]:5432 # pragma: allowlist secret
PG_DD_DIR=data
PG_DD_BUCKET=orcabus-test-data-843407916570-ap-southeast-2
PG_DD_PREFIX=pg-dd
Expand Down
6 changes: 4 additions & 2 deletions lib/workload/stateless/stacks/pg-dd/pg_dd/pg_dd.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,7 @@ def download_local(self, exists_ok: bool = True):
self.logger.info(f"file already exists: {file}")
continue

s3_object = self.s3.Object(self.bucket, obj.key)
s3_object.download_file(file)
s3_object = self.s3.Object(self.bucket, obj.key).get()
data = gzip.decompress(s3_object["Body"].read())
with open(file, "wb") as f:
f.write(data)
22 changes: 11 additions & 11 deletions lib/workload/stateless/stacks/pg-dd/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/workload/stateless/stacks/pg-dd/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "postgres-data-dump"
name = "pg-dd"
version = "0.1.0"
description = "A serivce to dump postgres databases to S3."
authors = ["Marko malenic <[email protected]>"]
Expand Down

0 comments on commit ae393eb

Please sign in to comment.