Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnqueueUniqueInByKey TTL not equal or greater than secondsFromNow #221

Open
kh411d opened this issue Oct 6, 2022 · 0 comments
Open

EnqueueUniqueInByKey TTL not equal or greater than secondsFromNow #221

kh411d opened this issue Oct 6, 2022 · 0 comments

Comments

@kh411d
Copy link

kh411d commented Oct 6, 2022

Hi, can't understand why the Redis key created by this EnqueueUniqueInByKey is not equal or greater than the secondsFromNow value, since this function is different from EnqueueUniqueByKey which doesn't have the secondsFromNow and only have 24h TTL

// EnqueueUniqueInByKey enqueues a job in the scheduled job queue that is unique on specified key for execution in secondsFromNow seconds. See EnqueueUnique for the semantics of unique jobs.
// Subsequent calls with same key will update arguments
func (e *Enqueuer) EnqueueUniqueInByKey(jobName string, secondsFromNow int64, args map[string]interface{}, keyMap map[string]interface{}) (*ScheduledJob, error) {
	enqueue, job, err := e.uniqueJobHelper(jobName, args, keyMap)
	if err != nil {
		return nil, err
	}

	scheduledJob := &ScheduledJob{
		RunAt: nowEpochSeconds() + secondsFromNow,
		Job:   job,
	}

	res, err := enqueue(&scheduledJob.RunAt)
	if res == "ok" && err == nil {
		return scheduledJob, nil
	}
	return nil, err
}
@kh411d kh411d changed the title EnqueueUniqueInByKey TTL not following secondsFromNow EnqueueUniqueInByKey TTL not equal or greater than secondsFromNow Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant