feat(actions): wait for delay (#263)

This commit is contained in:
ghostserverd 2022-05-09 08:48:56 -07:00 committed by GitHub
parent 9d52d42440
commit d112634947
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ package release
import (
"context"
"strings"
"time"
"github.com/autobrr/autobrr/internal/action"
"github.com/autobrr/autobrr/internal/domain"
@ -129,6 +130,13 @@ func (s *service) Process(release *domain.Release) {
}
}
// sleep for the delay period specified in the filter before running actions
delay := release.Filter.Delay
if delay > 0 {
log.Debug().Msgf("Delaying processing of '%v' (%v) for %v by %d seconds as specified in the filter", release.TorrentName, release.Filter.Name, release.Indexer, delay)
time.Sleep(time.Duration(delay) * time.Second)
}
var rejections []string
// run actions (watchFolder, test, exec, qBittorrent, Deluge, arr etc.)