2020-01-08 19:51:21 +01:00
|
|
|
package mutex
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
)
|
|
|
|
|
2020-04-03 18:08:49 +02:00
|
|
|
var (
|
2020-05-26 15:15:14 +02:00
|
|
|
Db = sync.Mutex{}
|
2021-12-09 02:33:41 +01:00
|
|
|
Index = sync.Mutex{}
|
|
|
|
People = Busy{}
|
2020-05-26 15:15:14 +02:00
|
|
|
MainWorker = Busy{}
|
|
|
|
SyncWorker = Busy{}
|
|
|
|
ShareWorker = Busy{}
|
2020-06-29 13:35:38 +02:00
|
|
|
MetaWorker = Busy{}
|
2021-08-24 14:27:34 +02:00
|
|
|
FacesWorker = Busy{}
|
2020-04-03 18:08:49 +02:00
|
|
|
)
|
2020-05-26 15:15:14 +02:00
|
|
|
|
|
|
|
// WorkersBusy returns true if any worker is busy.
|
|
|
|
func WorkersBusy() bool {
|
2021-08-24 14:27:34 +02:00
|
|
|
return MainWorker.Busy() || SyncWorker.Busy() || ShareWorker.Busy() || MetaWorker.Busy() || FacesWorker.Busy()
|
2020-05-26 15:15:14 +02:00
|
|
|
}
|