-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APIGOV-27875 - delay job pool checker and watcher until a job is regi…
…stered
- Loading branch information
1 parent
de615c6
commit af94c47
Showing
2 changed files
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,11 +49,6 @@ func newPool() *Pool { | |
} | ||
newPool.SetStatus(PoolStatusInitializing) | ||
|
||
// start routine to check all job status funcs and catch any failures | ||
go newPool.jobChecker() | ||
// start the pool watcher | ||
go newPool.watchJobs() | ||
|
||
return &newPool | ||
} | ||
|
||
|
@@ -75,6 +70,13 @@ func (p *Pool) setBackoff(backoff *backoff) { | |
func (p *Pool) recordJob(job JobExecution) string { | ||
p.jobsMapLock.Lock() | ||
defer p.jobsMapLock.Unlock() | ||
if len(p.jobs) > 0 && p.poolStatus == PoolStatusInitializing { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vivekschauhan
Author
Collaborator
|
||
// start routine to check all job status funcs and catch any failures | ||
go p.jobChecker() | ||
// start the pool watcher | ||
go p.watchJobs() | ||
} | ||
|
||
p.logger. | ||
WithField("job-id", job.GetID()). | ||
WithField("job-name", job.GetName()). | ||
|
Should this check be
len(p.jobs) == 0 && p.poolStatus == PoolStatusInitializing
? To only start them when initializing and no jobs yet registered?