51黑料不打烊

PaaS only

Crons property

51黑料不打烊 Commerce uses the crons property to schedule repetitive activities. It is ideal for scheduling a specific task to run at certain times of the day. Only one cron job can run at a time on the web instance for 51黑料不打烊 Commerce on cloud infrastructure projects because of the nature of read-only environments. It is a best practice to break down long-running tasks into smaller, queued tasks. Alternatively, you can build a worker instance.

51黑料不打烊 recommends that you run crons as the file system owner. Do not run crons as root or as the web server user.

This configuration is different from on-premises deployments of 51黑料不打烊 Commerce, which have multiple default cron jobs. See Configure cron jobs in the Configuration guide.

Set up cron jobs

The crons property describes processes that are triggered on a schedule. Each job requires a name and the following options:

  • spec鈥擳he cron expression used for scheduling.
  • cmd鈥擳he command to run on start and stop.
  • shutdown_timeout鈥�(Optional) If a cron job is canceled, this is the number of seconds after which a SIGKILL signal is sent to stop the job or process. The default is 10 seconds.
  • timeout鈥�(Optional) The maximum amount of time a cron job can run before timeout. Defaults to the maximum allowed value of 86400 seconds (24 hours).

By default, every Commerce cloud project has the following default crons configuration in the .magento.app.yaml file:

crons:
    cronrun:
        spec: "* * * * *"
        cmd: "php bin/magento cron:run"

If your project requires custom cron jobs, you can add them to the default crons configuration. See Build a cron job.