photoprism/internal/mutex/mutex.go
2020-05-26 19:27:29 +02:00

18 lines
330 B
Go

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