chore: further minor lint fixes
This commit is contained in:
@@ -106,7 +106,9 @@ func newIndexHandler(conn protocol.Connection, downloads *deviceDownloadState, f
|
||||
// information we have from them before accepting their
|
||||
// index, which will presumably be a full index.
|
||||
l.Debugf("Device %v folder %s does not announce an index ID", conn.DeviceID().Short(), folder.Description())
|
||||
sdb.DropAllFiles(folder.ID, conn.DeviceID())
|
||||
if err := sdb.DropAllFiles(folder.ID, conn.DeviceID()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else if startInfo.remote.IndexID != theirIndexID {
|
||||
// The index ID we have on file is not what they're
|
||||
// announcing. They must have reset their database and
|
||||
@@ -114,8 +116,12 @@ func newIndexHandler(conn protocol.Connection, downloads *deviceDownloadState, f
|
||||
// information we have and remember this new index ID
|
||||
// instead.
|
||||
l.Infof("Device %v folder %s has a new index ID (%v)", conn.DeviceID().Short(), folder.Description(), startInfo.remote.IndexID)
|
||||
sdb.DropAllFiles(folder.ID, conn.DeviceID())
|
||||
sdb.SetIndexID(folder.ID, conn.DeviceID(), startInfo.remote.IndexID)
|
||||
if err := sdb.DropAllFiles(folder.ID, conn.DeviceID()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := sdb.SetIndexID(folder.ID, conn.DeviceID(), startInfo.remote.IndexID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return &indexHandler{
|
||||
@@ -133,7 +139,7 @@ func newIndexHandler(conn protocol.Connection, downloads *deviceDownloadState, f
|
||||
}, nil
|
||||
}
|
||||
|
||||
// waitWhilePaused waits for the handler to resume
|
||||
// waitWhilePaused waits for the handler to resume.
|
||||
func (s *indexHandler) waitWhilePaused(ctx context.Context) error {
|
||||
s.cond.L.Lock()
|
||||
defer s.cond.L.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user