Skip to content

When using after, a frequency is not working #2565

@dstollie

Description

@dstollie

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());
      }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions