Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 534c983

Browse filesBrowse files
committed
Reword
1 parent 9caa9b4 commit 534c983
Copy full SHA for 534c983

File tree

Expand file treeCollapse file tree

1 file changed

+11
-18
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-18
lines changed

‎scheduler.rst

Copy file name to clipboardExpand all lines: scheduler.rst
+11-18Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -290,32 +290,25 @@ defined by PHP datetime functions::
290290

291291
You can also define periodic tasks using :ref:`the AsPeriodicTask attribute <scheduler-attributes-periodic-task>`.
292292

293-
Be aware that the message isn't passed to the messenger when you start the
294-
scheduler. The message will only be executed after the first frequency period
295-
has passed.
296-
297-
It's also possible to pass a from and until time for your schedule. For
298-
example, if you want to execute a command every day at 13:00::
293+
You can also define ``from`` and ``until`` times for your schedule::
299294

295+
// create a message every day at 13:00
300296
$from = new \DateTimeImmutable('13:00', new \DateTimeZone('Europe/Paris'));
301-
RecurringMessage::every('1 day', new Message(), from: $from);
302-
303-
Or if you want to execute a message every day until a specific date::
297+
RecurringMessage::every('1 day', new Message(), $from);
304298

299+
// create a message every day until a specific date::
305300
$until = '2023-06-12';
306-
RecurringMessage::every('1 day', new Message(), until: $until);
307-
308-
And you can even combine the from and until parameters for more granular
309-
control::
301+
RecurringMessage::every('1 day', new Message(), null, $until);
310302

303+
// combine from and until for more precise control
311304
$from = new \DateTimeImmutable('2023-01-01 13:47', new \DateTimeZone('Europe/Paris'));
312305
$until = '2023-06-12';
313-
RecurringMessage::every('first Monday of next month', new Message(), from: $from, until: $until);
306+
RecurringMessage::every('first Monday of next month', new Message(), $from, $until);
314307

315-
If you don't pass a from parameter to your schedule, the first frequency period
316-
is counted from the moment the scheduler is started. So if you start your
317-
scheduler at 8:33 and the message is scheduled to perform every hour, it
318-
will be executed at 9:33, 10:33, 11:33 and so on.
308+
When starting the scheduler, the message isn't sent to the messenger immediately.
309+
If you don't set a ``from`` parameter, the first frequency period starts from the
310+
moment the scheduler runs. For example, if you start it at 8:33 and the message
311+
is scheduled hourly, it will run at 9:33, 10:33, 11:33, etc.
319312

320313
Custom Triggers
321314
~~~~~~~~~~~~~~~

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.