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

_statuses uuid should not removed when expired but the status:uuid key-value exists #85

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

Conversation

comme
Copy link

@comme comme commented Jan 25, 2013

when i set

Resque::Plugins::Status::Hash.expire_in = 60

and i create a job get uuid1 and do

loop { Resque::Plugins::Status::Hash.set(uuid1,"message") }

after 60 second i create another job,in resque-web statuses page i can't find uuid1's info but status:uuid still exists in redis.
so i think _statuses uuid should not removed when expired but the status:uuid key-value exists.

@quirkey
Copy link
Owner

quirkey commented Jan 26, 2013

@comme Ah, yeah - this makes sense. However, I think a cleaner way to do this would be to just update the score/timestamp with ZSET whenever a message is written to the status/uuid so ZREMRANGEBYSCORE still works as expected and you never have to loop through the entire ZSET (potentially really slow for a lot of statuses)

@comme
Copy link
Author

comme commented Jan 28, 2013

@quirkey There is no ZSET command exists in redis but ZINCRBY and i don't think update the score/timestamp when a message is written to the status/uuid is a good solution, because after statuses expired (this periods of time i don't update uuid message) i call Resque::Plugins::Status::Hash.create before Resque::Plugins::Status::Hash.set the statuses will remove before you update the score/timestamp.

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.

2 participants