mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-06 10:07:45 +08:00
chore: add log
This commit is contained in:
@@ -33,7 +33,6 @@ type Server struct {
|
||||
tasks map[int]pkg.Torrent
|
||||
}
|
||||
|
||||
|
||||
func (s *Server) Serve() error {
|
||||
s.scheduler()
|
||||
s.reloadTasks()
|
||||
@@ -107,14 +106,13 @@ func (s *Server) MustTMDB() *tmdb.Client {
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
func (s *Server) reloadTasks() {
|
||||
runningTasks := s.db.GetRunningHistories()
|
||||
if len(runningTasks) == 0 {
|
||||
return
|
||||
}
|
||||
for _, t := range runningTasks {
|
||||
log.Infof("reloading task: %s", t.SourceTitle)
|
||||
log.Infof("reloading task: %d %s", t.ID, t.SourceTitle)
|
||||
torrent, err := transmission.ReloadTorrent(t.Saved)
|
||||
if err != nil {
|
||||
log.Errorf("relaod task %s failed: %v", t.SourceTitle, err)
|
||||
@@ -122,4 +120,4 @@ func (s *Server) reloadTasks() {
|
||||
}
|
||||
s.tasks[t.ID] = torrent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user