Comments (15)
Hi @lokielse, thank you for your message. That really sounds strange. I will check this.
from cron.
Okay I installed PHP Version 5.5.15-1~dotdeb.1
and have the following code:
Route::get('cron/test', function () {
Cron::setDisablePreventOverlapping();
Cron::setDatabaseLogging(true);
Cron::setLogOnlyErrorJobsToDatabase(false);
Cron::add('test_cron_1', '* * * * * *', function () {
});
Cron::add('test_cron_2', '0 0 * * *', function () {
});
Cron::add('test_cron_3', '0 1 * * *', function () {
});
Cron::add('test_cron_4', '0 2 * * *', function () {
});
Cron::add('test_cron_5', '0 3 * * *', function () {
});
Cron::add('test_cron_6', '0 4 * * *', function () {
});
Cron::add('test_cron_7', '0 5 * * *', function () {
});
Cron::add('test_cron_8', '0 6 * * *', function () {
});
Cron::add('test_cron_9', '0 9 * * *', function () {
});
Cron::add('test_cron_10', '0 12 * * *', function () {
});
return Cron::run();
});
Unfortunately it works for me and I don't get the Impossible CRON expression
. Can you provide me your code?
from cron.
I use your code snippet one by one.
cron commit hash 40aeff3f52038474abee47a3716c64a803dfd683
this work
Cron::add('test_cron_1', '* * * * * *', function () {
});
this one not work
Cron::add('test_cron_2', '0 0 * * *', function () {
});
and I truncate tables cron_job
and cron_manageer
.
Then after I reinstall your cron lib just now.
this one work
Cron::add('test_cron_2', '0 0 * * *', function () {
});
but this one not work
Cron::add('test_cron_3, '0 1 * * *', function () {
});
I guess that it related to the time.
from cron.
from cron.
That is really strange. I only get the Impossible CRON expression
if the expression is only for the past. For example Cron::add('test_cron_1', '* * * * * 2014', function () {});
works fine but Cron::add('test_cron_1', '* * * * * 2013', function () {});
does throw the exception. This behaviour is correct because using an expression which will never be true is an error. Please try to use Cron::add('test_cron_2', '0 0 * * * *', function () {});
. Can you print the complete stack trace?
from cron.
19. RuntimeException
…/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php321
18. Cron\CronExpression getRunDate
…/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php157
17. Cron\CronExpression getNextRunDate
…/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php252
16. Cron\CronExpression isDue
…/vendor/liebig/cron/src/Liebig/Cron/Cron.php219
15. Liebig\Cron\Cron run
…/workbench/pay/union/vendor/illuminate/support/Illuminate/Support/Facades/Facade.php205
14. Illuminate\Support\Facades\Facade __callStatic
…/app/routes.php32
13. Liebig\Cron\Facades\Cron run
…/app/routes.php32
from cron.
laravel config app.php
'timezone' => 'PRC',
php.ini
date.timezone = PRC
from cron.
Seems to be a timezone problem. Please try to change laravels timezone to UTC
.
from cron.
Yeah! solved.
I should use timezone PRC
, but php5.5.15 may not support PRC
I use Asia/Shanghai
instead and it works!!!
hahaha ;D
from cron.
thanks @liebig
from cron.
I am glad to hear this :) You are always welcome, @lokielse!
from cron.
http://php.net/manual/en/timezones.others.php
here is a warning.
Warning
Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons.
from cron.
Hello,
I have question
So it need to add time zone in
laravel config app.php
'timezone' => 'Asia/Shanghai',
and php.ini
date.timezone = Asia/Shanghai
or only in the laravel config app.php ?
Thank you.
from cron.
Both better while I changed only laravel config
from cron.
OK Thank you.
I have a little bit confuse about this cron package but I will create a new issue.
from cron.
Related Issues (20)
- Are tests working? HOT 2
- Incompatibility with Laravel 8, 9 HOT 1
- Exception with two closures on the same line of code HOT 3
- Symfony\Component\Console\Helper\HelperSet->get('table') HOT 3
- usage question: loading jobs from database HOT 3
- command cron:run/list error HOT 1
- stop cronjob run during beforeRun event HOT 3
- Cron job running only one time HOT 3
- Pull request #80 not in composer package HOT 3
- trying to understand why I should use this over Laravel's built-in scheduler HOT 2
- Which user should run cron HOT 2
- Laravel 5.4 support HOT 3
- PHP Fatal error: Class 'App\Providers\Cron' not found in C:\xampp\htdocs\isend\blog\app\Providers\AppServiceProvider.php on line 33 HOT 3
- laravel5.2.45 install failed HOT 2
- passing variable to the function parameter before adding a cron HOT 5
- Have Undefined index while run the cron job!!! HOT 3
- Php artisan cron:run Not working HOT 13
- Can't use `artisan route:cache` because the built-in cron route uses a closure HOT 5
- [Laravel 5.6] Ambiguous class resolution warning HOT 10
- doesn't work with Laravel 5.8 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cron.