Use jsoniter

This commit is contained in:
Ben Sarmiento
2023-12-02 06:54:38 +01:00
parent 91ca1ebf88
commit 01fe4f0a09
7 changed files with 64 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
package torrent
import (
"encoding/json"
"fmt"
"io"
"math"
@@ -296,11 +295,11 @@ func (t *TorrentManager) startRefreshJob() {
for {
<-time.After(time.Duration(t.Config.GetRefreshEverySeconds()) * time.Second)
checksum := t.getCurrentState()
if t.latestState.equal(checksum) {
continue
}
t.log.Infof("Detected changes! Refreshing %d torrents", checksum.TotalCount)
// checksum := t.getCurrentState()
// if t.latestState.equal(checksum) {
// continue
// }
// t.log.Infof("Detected changes! Refreshing %d torrents", checksum.TotalCount)
t.RefreshTorrents()
t.log.Info("Finished refreshing torrents")