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

@@ -111,8 +111,8 @@ func MainApp(configPath string) {
)
workerCount := config.GetNumberOfWorkers()
if workerCount < 10 {
workerCount = 10
if workerCount < 20 {
workerCount = 20
}
workerPool, err := ants.NewPool(workerCount)
if err != nil {
@@ -129,6 +129,7 @@ func MainApp(configPath string) {
config,
log.Named("realdebrid"),
)
rd.MonitorExpiredTokens()
premium.MonitorPremiumStatus(
workerPool,
@@ -153,6 +154,7 @@ func MainApp(configPath string) {
)
downloader := universal.NewDownloader(rd, workerPool)
downloader.StartResetBandwidthCountersJob()
router := chi.NewRouter()
handlers.AttachHandlers(