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

WARN -- : Scoped order is ignored, it's forced to be batch order when running running bin/rails heya:scheduler #186

Open
leemcalilly opened this issue Nov 5, 2022 · 4 comments

Comments

@leemcalilly
Copy link

Is it a problem that I am getting this error when running bin/rails heya:scheduler:

WARN -- : Scoped order is ignored, it's forced to be batch order

Or can I ignore that error message? I currently have an active campaign that had an issue with one of the campaign views, so no one has received an email in over a week.

When I try to run them manually with bin/rails heya:scheduler it appears that nothing is sending?

What happens when you have an active campaign and the mailer can't send after you fix the issue? Will it skip a step and pick up with the next one or should it send the backlogged step?

Trying to figure out where to start troubleshooting this issue on production.

@joshuap
Copy link
Member

joshuap commented Nov 8, 2022

WARN -- : Scoped order is ignored, it's forced to be batch order

I'm not sure about that one, although I am now seeing that in my log too. I don't remember seeing it before.

Regarding errors, was the error in the scheduler, or when sending the email? The scheduler shouldn't error, but if it does, it should pick up where it left off. It uses ActiveJob to do the work of sending the email, so for example, if you use Sidekiq, then Sidekiq's error handling mechanism should kick in, and it's the same as dealing with any other background job. I forget how long Sidekiq keep retrying a failed job, but I believe it's weeks by default. If the job goes to the morgue, however, it won't be reprocessed by Heya.

@leemcalilly
Copy link
Author

leemcalilly commented Nov 8, 2022

Ok. I'll ignore this error message then if it's not really causing any problems.

I think what happened is that my campaign failed due to a bug I pushed to production and then by the time I had it fixed everyone had reached the last step. I didn't realize I needed to resubscribe them if I add new steps after a campaign is started. My use-case is similar to this one:

#179

I'd like to continue adding steps to the end of the campaign. Would it work to simply add a rake task that does this before the heya:scheduler is scheduled to run?

User.all.each do |user| EvergreenCampaign.add(user, concurrent: true) end

I can try out a pull request for this issue when I have some time, but would that sort of rake task or adding a step like this step :do_not_unsubscribe, wait: 5.years { nil } be the better workaround in the meantime?

@joshuap
Copy link
Member

joshuap commented Nov 10, 2022

I'd like to continue adding steps to the end of the campaign. Would it work to simply add a rake task that does this before the heya:scheduler is scheduled to run?

User.all.each do |user| EvergreenCampaign.add(user, concurrent: true) end

I can try out a pull request for this issue when I have some time, but would that sort of rake task or adding a step like this step :do_not_unsubscribe, wait: 5.years { nil } be the better workaround in the meantime?

Yeah I think this would work in the meantime. As with everything, I'd try doing some manual testing with it in dev before rolling it out in production, just to make sure.

@joshuap
Copy link
Member

joshuap commented Oct 6, 2023

I'm not seeing this warning when running bin/rails heya:scheduler on Ruby 3.2.2 and Rails 7. Are you still seeing this @leemcalilly, and if so, what versions?

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

No branches or pull requests

2 participants