feat: return action rejections from arrs (#103)

* refactor: push status

* feat: return push status for arr actions
This commit is contained in:
Ludvig Lundgren 2022-01-29 17:53:44 +01:00 committed by GitHub
parent 20138030e1
commit 373c85f060
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 294 additions and 255 deletions

View file

@ -10,8 +10,8 @@ import (
"github.com/rs/zerolog/log"
)
const REANNOUNCE_MAX_ATTEMPTS = 30
const REANNOUNCE_INTERVAL = 7000
const ReannounceMaxAttempts = 30
const ReannounceInterval = 7000
func (s *service) qbittorrent(qbt *qbittorrent.Client, action domain.Action, hash string, torrentFile string) error {
log.Debug().Msgf("action qBittorrent: %v", action.Name)
@ -134,7 +134,7 @@ func checkTrackerStatus(qb qbittorrent.Client, hash string) error {
// initial sleep to give tracker a head start
time.Sleep(2 * time.Second)
for attempts < REANNOUNCE_MAX_ATTEMPTS {
for attempts < ReannounceMaxAttempts {
log.Debug().Msgf("qBittorrent - run re-announce %v attempt: %v", hash, attempts)
trackers, err := qb.GetTorrentTrackers(hash)
@ -157,7 +157,7 @@ func checkTrackerStatus(qb qbittorrent.Client, hash string) error {
attempts++
// add delay for next run
time.Sleep(REANNOUNCE_INTERVAL * time.Millisecond)
time.Sleep(ReannounceInterval * time.Millisecond)
continue
} else {