acaloiaro / neoq

Queue-agnostic background job library for Go, with a pleasant API and powerful features.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the future jobs check interval configurable in PgBackend

github-actions opened this issue · comments

// TODO Make the future jobs check interval configurable in PgBackend

	w.initFutureJobs(ctx, queue)

	// check for new future jobs on an interval
	// TODO Make the future jobs check interval configurable in PgBackend
	ticker := time.NewTicker(5 * time.Second)

	for {
		// loop over list of future jobs, scheduling goroutines to wait for jobs that are due within the next 30 seconds
		// TODO Make interval of time for which jobs are dedicated a goroutine configurable in PgBackend
		for jobID, runAfter := range w.futureJobs {
			at := time.Until(runAfter)
			if at <= time.Duration(30*time.Second) {

Closed in 895ea02

Closed in 895ea02