Add job for monitoring bw limit status of tokens

This commit is contained in:
Ben Adrian Sarmiento
2024-06-28 18:55:02 +02:00
parent c3aea427d0
commit 67111696a2
13 changed files with 136 additions and 55 deletions

View File

@@ -13,6 +13,7 @@ const (
MINIMUM_SLEEP = 60 // 60 seconds
)
// MonitorPremiumStatus is a permanent job that monitors the premium status of the user
func MonitorPremiumStatus(workerPool *ants.Pool, rd *realdebrid.RealDebrid, zurglog *logutil.Logger) {
var userInfo *realdebrid.User
var err error
@@ -52,8 +53,7 @@ func MonitorPremiumStatus(workerPool *ants.Pool, rd *realdebrid.RealDebrid, zurg
userInfo, err = rd.GetUserInformation()
if err != nil {
zurglog.Errorf("Failed to get user information: %v", err)
time.Sleep(5 * time.Minute)
continue
time.Sleep(time.Duration(MINIMUM_SLEEP) * time.Second)
}
}
})