- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
func (incident Incident) DeleteResponsibleMicroservices(microservices []string) {
var teamsDelete []string
responsibleMss := incident.GetResponsibleMicroservices()
for _, microservice := range microservices {
ResponsibleMssLoop:
for _, responsibleMs := range responsibleMss {
if microservice == responsibleMs.MicroserviceId {
service.GetInstanceDB().Delete(responsibleMs)
if team, ok := GetTeamByMs(microservice); ok != false {
for _, ms := range incident.GetResponsibleMicroservices() {
if teamFind, ok := GetTeamByMs(ms.MicroserviceId); ok != false && teamFind == team {
continue ResponsibleMssLoop
}
}
teamsDelete = append(teamsDelete, team)
}
}
}
}
if len(teamsDelete) > 0 {
incident.DeleteResponsibles(teamsDelete)
}
}