mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(actions): dont run in parallel (#182)
This commit is contained in:
parent
bb9e51f9d3
commit
2c7cbb4c22
1 changed files with 12 additions and 15 deletions
|
@ -21,22 +21,19 @@ func (s *service) RunActions(actions []domain.Action, release domain.Release) er
|
|||
|
||||
log.Debug().Msgf("process action: %v for '%v'", action.Name, release.TorrentName)
|
||||
|
||||
go func(release domain.Release, action domain.Action) {
|
||||
err := s.runAction(action, release)
|
||||
if err != nil {
|
||||
log.Err(err).Stack().Msgf("process action failed: %v for '%v'", action.Name, release.TorrentName)
|
||||
err := s.runAction(action, release)
|
||||
if err != nil {
|
||||
log.Err(err).Stack().Msgf("process action failed: %v for '%v'", action.Name, release.TorrentName)
|
||||
|
||||
s.bus.Publish("release:store-action-status", &domain.ReleaseActionStatus{
|
||||
ReleaseID: release.ID,
|
||||
Status: domain.ReleasePushStatusErr,
|
||||
Action: action.Name,
|
||||
Type: action.Type,
|
||||
Rejections: []string{err.Error()},
|
||||
Timestamp: time.Now(),
|
||||
})
|
||||
return
|
||||
}
|
||||
}(release, action)
|
||||
s.bus.Publish("release:store-action-status", &domain.ReleaseActionStatus{
|
||||
ReleaseID: release.ID,
|
||||
Status: domain.ReleasePushStatusErr,
|
||||
Action: action.Name,
|
||||
Type: action.Type,
|
||||
Rejections: []string{err.Error()},
|
||||
Timestamp: time.Now(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// safe to delete tmp file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue