|
|
@@ -80,13 +80,12 @@ func (s *Service) periodic(ctx context.Context) error {
|
|
|
t0 := time.Now()
|
|
|
l.Debugln("Periodic start")
|
|
|
|
|
|
- s.sdb.updateLock.Lock()
|
|
|
- defer s.sdb.updateLock.Unlock()
|
|
|
-
|
|
|
t1 := time.Now()
|
|
|
defer func() { l.Debugln("Periodic done in", time.Since(t1), "+", t1.Sub(t0)) }()
|
|
|
|
|
|
+ s.sdb.updateLock.Lock()
|
|
|
tidy(ctx, s.sdb.sql)
|
|
|
+ s.sdb.updateLock.Unlock()
|
|
|
|
|
|
return wrap(s.sdb.forEachFolder(func(fdb *folderDB) error {
|
|
|
fdb.updateLock.Lock()
|