Files
photoprism/internal/mutex/activities.go
Michael Mayer 424ed84f2a Backups: Add worker to create backups in the background #4237 #4243
In the next step, this worker can be configured to automatically create
index and/or album backups at regular intervals.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-05-10 17:41:32 +02:00

28 lines
685 B
Go

package mutex
// Activities that can be started and stopped.
var (
MainWorker = Activity{}
SyncWorker = Activity{}
BackupWorker = Activity{}
ShareWorker = Activity{}
MetaWorker = Activity{}
FacesWorker = Activity{}
UpdatePeople = Activity{}
)
// CancelAll requests to stop all activities.
func CancelAll() {
UpdatePeople.Cancel()
MainWorker.Cancel()
SyncWorker.Cancel()
ShareWorker.Cancel()
MetaWorker.Cancel()
FacesWorker.Cancel()
}
// IndexWorkersRunning checks if a worker is currently running.
func IndexWorkersRunning() bool {
return MainWorker.Running() || SyncWorker.Running() || ShareWorker.Running() || MetaWorker.Running() || FacesWorker.Running()
}