photoprism/internal/mutex/mutex.go
2021-08-24 14:27:34 +02:00

19 lines
373 B
Go

package mutex
import (
"sync"
)
var (
Db = sync.Mutex{}
MainWorker = Busy{}
SyncWorker = Busy{}
ShareWorker = Busy{}
MetaWorker = Busy{}
FacesWorker = Busy{}
)
// WorkersBusy returns true if any worker is busy.
func WorkersBusy() bool {
return MainWorker.Busy() || SyncWorker.Busy() || ShareWorker.Busy() || MetaWorker.Busy() || FacesWorker.Busy()
}