Skip to content

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

Open
comme wants to merge 3 commits into
quirkey:masterfrom
comme:master
Open

_statuses uuid should not removed when expired but the status:uuid key-value exists#85
comme wants to merge 3 commits into
quirkey:masterfrom
comme:master

Conversation

@comme

@comme comme commented Jan 25, 2013

Copy link
Copy Markdown

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

quirkey commented Jan 26, 2013

Copy link
Copy Markdown
Owner

@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

comme commented Jan 28, 2013

Copy link
Copy Markdown
Author

@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