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

added uniq parameter, update readme #137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

overquota
Copy link

Do not queue scheduled job if it is already present in destination queue
By default False == save default behaivor

@overquota
Copy link
Author

anybody here?


# If job is a repeated job, decrement counter
if repeat:
job.meta['repeat'] = int(repeat) - 1

queue = self.get_queue_for_job(job)
queue.enqueue_job(job)
if not uniq or uniq and job.id not in queue.get_job_ids():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will kill performance if we have a queue with many jobs. I'm not against this feature, but it will have to be implemented in a scaleable way.

I think we can use a set to check for whether this specific function is already scheduled.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worthwhile to just add a comment around this flag about a possible performance hit? Seems like a popular feature request.

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

Successfully merging this pull request may close these issues.

3 participants