chore(sqlite): allow periodic database maintenance to be disabled (#10441)

This change allows the periodic database maintenance to be disabled, while providing a way to programmatically start maintenance at a convenient moment.

Signed-off-by: Tommy van der Vorst <tommy@pixelspark.nl>
This commit is contained in:
Tommy van der Vorst
2026-01-14 21:10:54 +00:00
committed by GitHub
parent ed0baec2ca
commit 5bf27a432c
4 changed files with 40 additions and 9 deletions
+10 -1
View File
@@ -15,8 +15,17 @@ import (
"github.com/thejerf/suture/v4"
)
type DBService interface {
suture.Service
// Starts maintenance asynchronously, if not already running
StartMaintenance()
}
type DB interface {
Service(maintenanceInterval time.Duration) suture.Service
// Create a service that performs database maintenance periodically (no
// more often than the requested interval)
Service(maintenanceInterval time.Duration) DBService
// Basics
Update(folder string, device protocol.DeviceID, fs []protocol.FileInfo) error