~egtann/sjs

bb67a058c76667bb58a0d1759c43fbe911f0330e — Evan Tann 1 year, 9 months ago e3aa541
fix data race
1 files changed, 3 insertions(+), 0 deletions(-)

M job.go
M job.go => job.go +3 -0
@@ 166,6 166,9 @@ func scheduleJobWithTimeout(workerMap *WorkerMap, j *Job) error {
// run a job. If no workers are available with that capability, then report an
// error.
func run(ctx context.Context, m *WorkerMap, j *Job) error {
	m.mu.RLock()
	defer m.mu.RUnlock()

	worker := m.GetWorkerForJobName(j.Name)
	if worker == nil {
		return fmt.Errorf("no workers capable of %s", j.Name)