INFRA-3026 : Skip already_in_channel error for alerting during auto escalation (#398)

This commit is contained in:
Vijay Joshi
2024-03-14 14:44:57 +05:30
committed by GitHub
parent 04252b8248
commit f40eb669a3
2 changed files with 9 additions and 6 deletions

View File

@@ -43,11 +43,12 @@ const (
)
const (
UserChangeEvent = "user_change"
DeactivatedUserName = "Deactivated User"
AlreadyArchivedError = "already_archived"
NotInChannelError = "not_in_channel"
NotFoundError = "not found"
UserChangeEvent = "user_change"
DeactivatedUserName = "Deactivated User"
AlreadyArchivedError = "already_archived"
NotInChannelError = "not_in_channel"
NotFoundError = "not found"
AlreadyInChannelError = "already_in_channel"
)
const (

View File

@@ -197,7 +197,9 @@ func updatingSevForEachInc(incidents []incident.IncidentEntity, i int, incidentS
_, err := socketModeClient.Client.InviteUsersToConversation(incidents[i].SlackChannel, o)
if err != nil {
logger.Error("Slack Client InviteUsersToConversation error in cron job")
metrics.PublishCronJobFailureMetrics(AUTO_ESCALATE, err.Error())
if err.Error() != util.AlreadyInChannelError {
metrics.PublishCronJobFailureMetrics(AUTO_ESCALATE, err.Error())
}
}
}