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

Change hook names to be more delayed-job specific #1060

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

effron
Copy link

@effron effron commented Oct 29, 2018

This aims to change the delayed job hooks to have more specific names to avoid collisions. Because of performable_method, many objects can be turned into delayed job payload objects. If those objects happen to define methods with names like "before", "after", "error", or "success", those methods will be called by the job runner. This can cause surprising bugs and behaviors. (A similar problem is mentioned in this pr #943)

This aims to change the names of those methods to be more specific to running delayed jobs to make them harder to collide with accidentally.

This is a breaking change, so we could also do work to phase this change in more slowly if it's desirable (deprecate hooks with the old names, run new or old hook name -- whichever is present -- and then remove the old hook names in a following version)

@betamatt
Copy link
Collaborator

No breaking changes, please. I think you're on the right path for how to phase it in. Note that "phase in" may last a very long time. DJ has slow release cycles and values stability.

  1. support for both naming schemes at the same time
  2. a deprecation warning when the old naming is invoked
  3. a mode flag which indicates whether both naming schemes should be invoked, or just the new one

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