We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
use Hyperf\Nano\Factory\AppFactory; require_once __DIR__ . '/vendor/autoload.php'; $app = AppFactory::createSwow(); $app->config([ 'processes'=> [ Hyperf\Crontab\Process\CrontabDispatcherProcess::class,], 'crontab' => [ 'enable' => true, ], ]); $app->addCrontab('* * * * * *', function(){ echo "A new Crontab called echo!"; $file = 'log.txt'; // 向文件追加写入内容 // 使用 FILE_APPEND 标记,可以在文件末尾追加内容 file_put_contents($file, time(), FILE_APPEND | LOCK_EX); });
定时回调里面的代码没有执行
The text was updated successfully, but these errors were encountered:
记得安装 hyperf/process 包
hyperf/process
Sorry, something went wrong.
No branches or pull requests
定时回调里面的代码没有执行
The text was updated successfully, but these errors were encountered: