Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
check change event type before container name (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored Jul 15, 2021
1 parent f769364 commit db66a1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api-service/__app__/queue_file_changes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ def file_added(event: Dict, fail_task_on_transient_error: bool) -> None:
def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
event = json.loads(msg.get_body())
last_try = msg.dequeue_count == MAX_DEQUEUE_COUNT
if event["topic"] not in corpus_accounts():
# check type first before calling Azure APIs
if event["eventType"] != "Microsoft.Storage.BlobCreated":
return

if event["eventType"] != "Microsoft.Storage.BlobCreated":
if event["topic"] not in corpus_accounts():
return

file_added(event, last_try)
Expand Down

0 comments on commit db66a1d

Please sign in to comment.