2022-09-28 09:01:17 +02:00
|
|
|
package mutex
|
|
|
|
|
|
|
|
// Activities that can be started and stopped.
|
|
|
|
var (
|
|
|
|
MainWorker = Activity{}
|
|
|
|
SyncWorker = 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()
|
|
|
|
}
|
|
|
|
|
2022-10-03 22:59:29 +02:00
|
|
|
// IndexWorkersRunning checks if a worker is currently running.
|
|
|
|
func IndexWorkersRunning() bool {
|
2022-09-28 09:01:17 +02:00
|
|
|
return MainWorker.Running() || SyncWorker.Running() || ShareWorker.Running() || MetaWorker.Running() || FacesWorker.Running()
|
|
|
|
}
|