hotfix(storage): JSON provider versioning safety
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
func (s *Storage) logVersionDiff(provider string, hardcodedVersion, persistedVersion uint16) {
|
||||
message := provider + " servers from file discarded because they have version " +
|
||||
strconv.Itoa(int(persistedVersion)) +
|
||||
" and hardcoded servers have version " +
|
||||
strconv.Itoa(int(hardcodedVersion))
|
||||
s.logger.Info(message)
|
||||
}
|
||||
|
||||
func (s *Storage) logTimeDiff(provider string, persistedUnix, hardcodedUnix int64) {
|
||||
diff := time.Unix(persistedUnix, 0).Sub(time.Unix(hardcodedUnix, 0))
|
||||
if diff < 0 {
|
||||
|
||||
Reference in New Issue
Block a user