1. Go to this page and download the library: Download asmoday74/yii2-tasks library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
asmoday74 / yii2-tasks example snippets
'modules' => [
...
'tasks' => [
'class' => 'asmoday74\tasks\Module',
//optional config
'jobsPath' => '@app/jobs', //path to job dir
'maxExecutionTimeDirector' => 60, //maximum execution time of the director of the tasks
'maxExecutionTimeWorker' => 600, //maximum task execution time. This value has priority in relation to the value established in the task itself.
'minTimeRestart' => 60, //the minimum time before the restart of an erroneous task
'sleepTime' => 1, //waiting time if there are no tasks, in seconds
'deleteSuccessfulComplete' => true, //delete the task from the list after successful execution
'deleteErrorTask' => true, //delete the task from the list after the end of attempts to execute
'defaultMaxRestartCount' => 0 //the number of restart of the default task in case of error. 0 - endlessly
],
...
],