Refactor structure, use cobra
This commit is contained in:
@@ -40,7 +40,6 @@ type TorrentManager struct {
|
||||
antsPool *ants.Pool
|
||||
unrestrictPool *ants.Pool
|
||||
log *zap.SugaredLogger
|
||||
mu *sync.Mutex
|
||||
}
|
||||
|
||||
// NewTorrentManager creates a new torrent manager
|
||||
@@ -55,7 +54,6 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
|
||||
requiredVersion: "18.11.2023",
|
||||
antsPool: p,
|
||||
log: log,
|
||||
mu: &sync.Mutex{},
|
||||
}
|
||||
|
||||
unrestrictPool, err := ants.NewPool(t.Config.GetUnrestrictWorkers())
|
||||
@@ -65,8 +63,6 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
|
||||
t.unrestrictPool = unrestrictPool
|
||||
}
|
||||
|
||||
ensureDir(DATA_DIR)
|
||||
|
||||
// create internal directories
|
||||
t.DirectoryMap.Set(INT_ALL, cmap.New[*Torrent]()) // key is AccessKey
|
||||
t.DirectoryMap.Set(INT_INFO_CACHE, cmap.New[*Torrent]()) // key is Torrent ID
|
||||
|
||||
Reference in New Issue
Block a user