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

Persist the RequestStore at job execution #3

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

Conversation

cyrill62
Copy link

@cyrill62 cyrill62 commented Aug 9, 2018

If the persist feature is active:

RequestStore::Sidekiq.configure do |config|
  # Enable store persistance a job execution.
  config.persist = true
end

The RequestStore.store is saved and restored at job execution.

It allows you to save the store for retried jobs or keep the same store for jobs pushed by another job with a store.

@cyrill62 cyrill62 changed the title Restore the RequestStore at job execution Persist the RequestStore at job execution Aug 9, 2018
@machty
Copy link

machty commented Sep 10, 2018

This is nice.

(I'm not 100% sure but) one additional thing I'd need before I could use this is a way to strip the serialized RequestStore of certain complex objects that might not be serializable; I know I've run into cases where some 3rd party gem checks for the existence of RequestStore and then adds an object that can't be serialized to JSON because of some cyclical data structure.

@cyrill62
Copy link
Author

Perhaps we can serialize the store in the middleware, then skip not serializable objects.

I'll write a test to reproduce this case.

@Laykou
Copy link

Laykou commented Jun 1, 2020

@cyrill62 Hi, do you have any intention moving this forward? :)

@macfanatic
Copy link
Member

Super late to the party here 🎉 but is there anything new on this that I should be aware of. First off, it's gorgeous code and I can see the need and use case for this, so even with the limitation outlined with cyclical objects I'd be inclined to include and release.

Curious if @cyrill62, have you used this in production on a fork without issues, have more to commit here, etc?

Thanks for all the hard work!

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.

4 participants