Skip to content

Commit

Permalink
Fixes to clean_slack_channel_leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantinov-Innokentii committed Nov 16, 2022
1 parent 83f281c commit f5fd3dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion engine/apps/slack/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,10 @@ def clean_slack_channel_leftovers(slack_team_identity_id, slack_channel_id):
logger.info(
f"Set general_log_channel_id to None for org_id={org.id} slack_channel_id={slack_channel_id} since slack_channel is arcived or deleted"
)
org.general_log_channel_id = None
orgs_to_clean_general_log_channel_id.append(org)
ChannelFilter.objects.filter(alert_receive_channel__organization=org).update(slack_channel_id=None)
ChannelFilter.objects.filter(alert_receive_channel__organization=org, slack_channel_id=slack_channel_id).update(
slack_channel_id=None
)

Organization.objects.bulk_update(orgs_to_clean_general_log_channel_id, ["general_log_channel_id"], batch_size=5000)

0 comments on commit f5fd3dd

Please sign in to comment.