Skip to content

Commit

Permalink
make manifest/seal upload more resiliant
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Jan 17, 2024
1 parent d32dc62 commit e0e2423
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ async def backup_channel(channel, last_message_id):
if is_s3_enabled():
# upload manifest and seal
manifest_seal_path, s3_manifest_seal_path = get_manifest_seal_path(channel.guild.id, channel.id)
S3_CLIENT.upload_file(manifest_path, s3_bucket(), s3_manifest_path)
S3_CLIENT.upload_file(manifest_seal_path, s3_bucket(), s3_manifest_seal_path)
if os.path.exists(manifest_path):
S3_CLIENT.upload_file(manifest_path, s3_bucket(), s3_manifest_path)
S3_CLIENT.upload_file(manifest_seal_path, s3_bucket(), s3_manifest_seal_path)
else:
print(f'No manifest for {guild_id} - {channel_id}. Likly empty channel. Skipping S3 upload.')

return after.id

Expand Down

0 comments on commit e0e2423

Please sign in to comment.