Fix all errcheck warnings
This commit is contained in:
@@ -103,8 +103,8 @@ var _ = Describe("ChangeDetector", func() {
|
||||
Expect(changed).To(BeEmpty())
|
||||
Expect(changed).To(BeEmpty())
|
||||
|
||||
f, err := os.Create(filepath.Join(testFolder, "a", "b", "new.txt"))
|
||||
f.Close()
|
||||
f, _ := os.Create(filepath.Join(testFolder, "a", "b", "new.txt"))
|
||||
_ = f.Close()
|
||||
changed, deleted, err = newScanner.Scan(lastModifiedSince)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(deleted).To(BeEmpty())
|
||||
|
||||
+3
-7
@@ -72,7 +72,9 @@ func (s *Scanner) getLastModifiedSince(folder string) time.Time {
|
||||
|
||||
func (s *Scanner) updateLastModifiedSince(folder string, t time.Time) {
|
||||
millis := t.UnixNano() / int64(time.Millisecond)
|
||||
s.ds.Property(nil).Put(model.PropLastScan+"-"+folder, fmt.Sprint(millis))
|
||||
if err := s.ds.Property(context.TODO()).Put(model.PropLastScan+"-"+folder, fmt.Sprint(millis)); err != nil {
|
||||
log.Error("Error updating DB after scan", err)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Scanner) loadFolders() {
|
||||
@@ -85,12 +87,6 @@ func (s *Scanner) loadFolders() {
|
||||
|
||||
type Status int
|
||||
|
||||
const (
|
||||
StatusComplete Status = iota
|
||||
StatusInProgress
|
||||
StatusError
|
||||
)
|
||||
|
||||
type StatusInfo struct {
|
||||
MediaFolder string
|
||||
Status Status
|
||||
|
||||
Reference in New Issue
Block a user