diff --git a/wis2box-management/wis2box/pubsub/subscribe.py b/wis2box-management/wis2box/pubsub/subscribe.py index 38e59992..9b9363fc 100644 --- a/wis2box-management/wis2box/pubsub/subscribe.py +++ b/wis2box-management/wis2box/pubsub/subscribe.py @@ -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}')