Skip to content

Commit

Permalink
avoid error on directory creation
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Dec 24, 2024
1 parent 9dbb256 commit 8877a18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wis2box-management/wis2box/pubsub/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def on_message_handler(self, client, userdata, msg):
message.get('EventName', '') in ['s3:ObjectCreated:Put', 's3:ObjectCreated:CompleteMultipartUpload']): # noqa
LOGGER.debug('Storing data')
key = str(message['Key'])
# if key ends with / then it is a directory
if key[-1] == '/':
LOGGER.info(f'Do not process directories: {key}')
return
filepath = f'{STORAGE_SOURCE}/{key}'
if key.startswith(STORAGE_ARCHIVE):
LOGGER.info(f'Do not process archived-data: {key}')
Expand Down

0 comments on commit 8877a18

Please sign in to comment.