mirror of https://github.com/portainer/portainer
fix deadlock situation (#10360)
parent
fb7a2fbbe6
commit
ec091efe3b
|
@ -155,12 +155,16 @@ func (handler *Handler) updateEndpointGroup(tx dataservices.DataStoreTx, endpoin
|
||||||
err = handler.AuthorizationService.CleanNAPWithOverridePolicies(tx, &endpoint, endpointGroup)
|
err = handler.AuthorizationService.CleanNAPWithOverridePolicies(tx, &endpoint, endpointGroup)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Update flag with endpoint and continue
|
// Update flag with endpoint and continue
|
||||||
handler.PendingActionsService.Create(portainer.PendingActions{
|
go func(endpointID portainer.EndpointID, endpointGroupID portainer.EndpointGroupID) {
|
||||||
EndpointID: endpoint.ID,
|
err := handler.PendingActionsService.Create(portainer.PendingActions{
|
||||||
|
EndpointID: endpointID,
|
||||||
Action: "CleanNAPWithOverridePolicies",
|
Action: "CleanNAPWithOverridePolicies",
|
||||||
ActionData: endpointGroup.ID,
|
ActionData: endpointGroupID,
|
||||||
})
|
})
|
||||||
log.Warn().Err(err).Msgf("Unable to update user authorizations for endpoint (%d) and endpoint group (%d).", endpoint.ID, endpointGroup.ID)
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msgf("Unable to create pending action to clean NAP with override policies for endpoint (%d) and endpoint group (%d).", endpointID, endpointGroupID)
|
||||||
|
}
|
||||||
|
}(endpoint.ID, endpointGroup.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue