8000 [Scheduler] Document hashed cron expressions by javiereguiluz · Pull Request #19429 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Scheduler] Document hashed cron expressions #19429

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

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions scheduler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,28 @@ class, as shown in the following examples.
Cron Expression Triggers
~~~~~~~~~~~~~~~~~~~~~~~~

It uses the same syntax as the `cron command-line utility`_::
Before using cron triggers, you have to install the following dependency:

.. code-block:: terminal

composer require dragonma 8000 ntank/cron-expression

Then, define the trigger date/time using the same syntax as the
`cron command-line utility`_::

RecurringMessage::cron('* * * * *', new Message());

Before using it, you have to install the following dependency:
You can also used some special values that represent common cron expressions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can also used some special values that represent common cron expressions:
You can also use some special values that represent common cron expressions:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed while merging. Thanks.


.. code-block:: terminal
* ``#yearly``, ``#annually`` - Run once a year, midnight, Jan. 1 - ``0 0 1 1 *``
* ``#monthly`` - Run once a month, midnight, first of month - ``0 0 1 * *``
* ``#weekly`` - Run once a week, midnight on Sun - ``0 0 * * 0``
* ``#daily``, ``#midnight`` - Run once a day, midnight - ``0 0 * * *``
* ``#hourly`` - Run once an hour, first minute - ``0 * * * *``

composer require dragonmantank/cron-expression
For example::

RecurringMessage::cron('#daily', new Message());

.. tip::

Expand Down
0