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

When using after, a frequency is not working #2565

Open
dstollie opened this issue Oct 30, 2022 · 1 comment
Open

When using after, a frequency is not working #2565

dstollie opened this issue Oct 30, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dstollie
Copy link

When using a frequency in combination with after. Then scheduler garbare resolver does not what I expect it to do.

With below code

     Scheduler::init('IncompleteSubmissionMissingMeterSerialMailable')
                ->mailable(new IncompleteSubmissionMissingMeterSerialMailable($submission->id))
                ->target($submission)
                ->daily()
                ->stopable()
                ->after(now()->addHour())
                ->save();

I expect that "The mail is being being sent daily starting in an hour. Untill one of the constraints is being touched.". Techincally this means that completed_at should never be set until the constraint is hit.

In practice this is not working because the completed_at value is always being set by the garbage resolver when using after as a time_frame_origin

This isRepetitive should also be added to the after origin I think

      if ($this->isBefore()) {
          if ($this->isRepetitive()) {
              return true;
          }

          return now()->lt($this->triggerTarget());
      }
@binaryk
Copy link
Contributor

binaryk commented Nov 22, 2022

Thanks @dstollie , I think I know what you mean. We'll work on that.

@binaryk binaryk added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Nov 22, 2022
@binaryk binaryk self-assigned this Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants