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

Using Redis TTL to expire keys after a certain point #48

Merged
merged 2 commits into from
Feb 5, 2018

Conversation

dmitrypol
Copy link
Contributor

@dmitrypol dmitrypol commented Dec 15, 2017

Per discussion in #26 here is a first attempt at expiring workflow keys. Please consider for including this feature in the library or modify as appropriate.

  1. Added config.ttl to use Redis TTL to expire keys set for various work…
  2. Added expire_workflow and expire_job methods to client
  3. Right now you need to manually call expire! to set expiration for the workflow keys. Alternative design would be to leverage callback that will automatically call this after last job in workflow completes.

I added a test for Client.expire_workflow but I think fakeredis TTL does not work quite the same as Redis (had issues w it in the past).

On separate note I updated README with suggestion on how to check whether workflow is running w particular class name. Helps avoid overlapping workflow same class.

Dmitry

Dmitry Polyakovksy added 2 commits December 15, 2017 14:49
…flows

added expire_workflow and expire_job methods to client

Right now you need to manually call expire! to set expiration for the workflow keys.  Alternative design would be to leverage callback that will automatically call this after last job in workflow completes.
@pokonski
Copy link
Contributor

pokonski commented Feb 5, 2018

Hey @dmitrypol!

Apologies for super late reply, this looks really great! I only have some notes about the text in readme, but will adjust after merging :)

And yeah, this is a good time to switch to actual Redis servers to test TTL.

@pokonski pokonski merged commit 2b05f10 into chaps-io:master Feb 5, 2018
@pokonski
Copy link
Contributor

pokonski commented Feb 5, 2018

@dmitrypol this is now released in version 1.1.0 🥇

@dmitrypol
Copy link
Contributor Author

Thanks for merging it. Completely understand slow response, life is busy.

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.

None yet

2 participants