allprogrammic/resque-bundle

Symfony ResqueBundle

安装次数: 9258

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 3

开放问题: 5

语言:JavaScript

类型:symfony-bundle

v1.0.0 2020-08-18 08:15 UTC

This package is auto-updated.

Last update: 2024-09-08 15:36:01 UTC


README

重复任务

配置

您可以通过定义一个专用的配置文件来设置重复任务,如下所示:

tasks_name:
    cron: "*/5 * * * *" (cron format)
    class: ~
    queue: ~
    args: ~
    description: ~

警报

请记住包含并配置SwiftmailerBundle以使用警报。

public function registerBundles()
{
    $bundles = array(
        // ...
        new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
    );

    // ...
}

执行

为了设置您的重复任务,您只需要在调用resque:recurring命令时指定要使用的文件,如下所示:

resque:recurring [le_chemin_de_votre_fichier_de_configuration]

cron表达式

*    *    *    *    *
-    -    -    -    -
|    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
|    |    |    +---------- month (1 - 12)
|    |    +--------------- day of month (1 - 31)
|    +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)