Skip to content

Commit

Permalink
fix(s3-batch-exports): Call complete after uploading last part (#17763)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias authored Oct 4, 2023
1 parent 9255daa commit 97a887d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions posthog/temporal/workflows/s3_batch_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ async def __aenter__(self):
return self

async def __aexit__(self, exc_type, exc_value, traceback) -> bool:
if exc_value is None:
# Succesfully completed the upload
await self.complete()
return True

if exc_type == asyncio.CancelledError:
# Ensure we clean-up the cancelled upload.
await self.abort()
Expand Down Expand Up @@ -445,6 +440,8 @@ async def worker_shutdown_handler():
last_uploaded_part_timestamp = result["inserted_at"]
activity.heartbeat(last_uploaded_part_timestamp, s3_upload.to_state())

await s3_upload.complete()


@workflow.defn(name="s3-export")
class S3BatchExportWorkflow(PostHogWorkflow):
Expand Down

0 comments on commit 97a887d

Please sign in to comment.