定制 spatie/laravel-cronless-schedule 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spatie/laravel-cronless-schedule

最新稳定版本:1.2.1

Composer 安装命令:

composer require spatie/laravel-cronless-schedule

包简介

Run the Laravel scheduler without relying on cron

README 文档

README

Latest Version on Packagist Tests Total Downloads

Laravel's native scheduler relies on cron to be executed every minute. It's rock solid and in most cases you should stick to using it.

If you want to simulate the scheduler running every minute in a test environment, using cron can be cumbersome. This package provides a command to run the scheduler every minute, without relying on cron. Instead it uses a ReactPHP loop.

This is how you can start the cronless schedule:

php artisan schedule:run-cronless

This command will never end. Behind the scenes it will execute php artisan schedule every minute.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer. Probably you only want to use this schedule in a development environment.

composer require spatie/laravel-cronless-schedule --dev

Usage

This is how you can start the cronless schedule:

php artisan schedule:run-cronless

By default, it will run every minute.

Manually triggering a run

To perform an extra run of the scheduler, just press enter.

Using an alternative frequency

If you want to run the scheduler at another frequency, you can pass an amount of seconds to the frequency option. Here is an example where the schedule will be run every 5 seconds.

php artisan schedule:run-cronless --frequency=5

Using another command

If you want to run another command instead of the scheduler, just can pass it to the command option. Here is an example where another command will be run every 5 seconds.

php artisan schedule:run-cronless --command=your-favorite-artisan-command

Only run the schedule for a certain period

By default, the command will run forever. You can shorten that period by passing an amount of seconds to the stop-after-seconds option.

In this example we'll stop the command after 5 seconds

php artisan schedule:run-cronless --stop-after-seconds=5

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 292.4k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 380
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 377
  • Watchers: 8
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-10