Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 13, 2019 02:33 pm GMT

Call for Contributions: Move DelayedJob Calls to ActiveJob

Hey folks, we've been working on a gradual migration from DelayedJob to ActiveJob within the DEV codebase.

GitHub logo Move delay calls to ActiveJob #3136

As described in #2497, to be less dependent of DelayedJob we also need to move jobs which are created by calling delay method to ActiveJob:

Here is the list of the calls:

  • [x] Slackbot.ping
  • [ ] MembershipMailer.delay.new_membership_subscription_email
  • [ ] MembershipMailer.delay.subscription_update_confirm_email
  • [ ] MembershipMailer.delay.subscription_cancellation_email
  • [ ] user.follow
  • [ ] reaction.create
  • [ ] ArticleAnalyticsFetcher.new.update_analytics
  • [ ] HtmlVariantSuccess.create
  • [ ] HtmlVariantTrial.create
  • [ ] message.send_push
  • [ ] RssReader.new.fetch_user
  • [ ] several calls in trigger_delayed_index

Actions for each of the calls:

  • create a corresponding ActiveJob, specify a queue name
  • call the required method inside a job
  • replace the delay method calls with a job perform_later call
  • you may need to modify the existing tests by using perform_enqueued_job instead of run_background_jobs_immediately helper

Remember to pass record ids (if needed) instead of ActiveRecord objects to a job to avoid deserialization errors (#1621)

Take a look at the issue. We have a lot of merged pull requests to use as a guideline to get you started, for example...

GitHub logo Moved send_mention_notification to ActiveJob #3566

What type of PR is this? (check all applicable)

  • [x] Refactor

Description

  • moved send_mention_notification to ActiveJob
  • used @copasetickid's pr and refined it

Related Tickets & Documents

#1996

Happy coding!


Original Link: https://dev.to/devteam/call-for-contributions-move-delayedjob-calls-to-activejob-5d7l

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To