photoprism/internal/mutex/mutex.go
Michael Mayer 968cd71f34 Backend: Add groom worker and test stubs #154
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-26 15:15:14 +02:00

19 lines
330 B
Go

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