Skip to content

Commit

Permalink
test17
Browse files Browse the repository at this point in the history
  • Loading branch information
akiioto committed Oct 18, 2024
1 parent e3751f3 commit c8ab48f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/cloud-run/slack-message-sender/slack-message-sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ def get_slack_user_mapping():
@app.route("/issue-labeled", methods=["POST"])
def issue_labeled() -> Response:
'''This function sends information about labeled issues in a Slack channel'''
# Cache the user mapping to avoid frequent API calls
slack_user_mapping = get_slack_user_mapping()
log_fields: Dict[str, Any] = prepare_log_fields()
log_fields["labels"]["io.kyma.app"] = "issue-labeled"
try:
Expand All @@ -322,6 +320,9 @@ def issue_labeled() -> Response:
org = payload["repository"]["owner"]["login"]
issue_url = payload["issue"]["html_url"]

# Cache the user mapping to avoid frequent API calls
slack_user_mapping = get_slack_user_mapping()

assignee_name = payload.get("assigneeName")
assignee_slack_id = None
if assignee_name:
Expand Down

0 comments on commit c8ab48f

Please sign in to comment.