Skip to content

Commit

Permalink
Delete message when object is not in bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
bensteinberg committed Nov 6, 2024
1 parent c47c323 commit 0e8a30d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions perma_mirror/poll_for_warcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def main(queue, messages, directory, prefix, skip, sleep, repeat):
except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == '404':
click.echo(f'WARNING: {key} is not in {bucket}')
click.echo(f'Deleting message {message.body}')
message.delete()
elif e.response['Error']['Code'] == 'NoSuchKey':
click.echo(f'WARNING: NoSuchKey: {key}')
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "perma_mirror"
version = "0.3.7"
version = "0.3.8"
description = "This program watches an SQS queue and downloads newly-created S3 objects"
authors = ["Ben Steinberg <[email protected]>"]
license = "GPL-3.0-only"
Expand Down

0 comments on commit 0e8a30d

Please sign in to comment.