Moving Queue and Ratio checks to cron (fixes failure to stop on ratio)

This commit is contained in:
2018-09-10 15:18:30 -04:00
parent 224e7892ef
commit a5e9b6745f
5 changed files with 82 additions and 59 deletions

View File

@@ -1,6 +1,7 @@
package storage
import (
"fmt"
"os"
"path/filepath"
@@ -146,11 +147,11 @@ func FetchAllStoredTorrents(torrentStorage *storm.DB) (torrentLocalArray []*Torr
//AddTorrentLocalStorage is called when adding a new torrent via any method, requires the boltdb pointer and the torrentlocal struct
func AddTorrentLocalStorage(torrentStorage *storm.DB, local TorrentLocal) {
Logger.WithFields(logrus.Fields{"Storage Path": local.StoragePath, "Torrent": local.TorrentName, "File(if file)": local.TorrentFileName}).Info("Adding new Torrent to database")
fmt.Println("ENTIRE TORRENT", local)
err := torrentStorage.Save(&local)
if err != nil {
Logger.WithFields(logrus.Fields{"database": torrentStorage, "error": err}).Error("Error adding new Torrent to database!")
}
}
//DelTorrentLocalStorage is called to delete a torrent when we fail (for whatever reason to load the information for it). Deleted by HASH matching.