Comments (10)
Hi herodev777,
thanks for using Cron. Can you post the complete error message with stack trace when you call Cron from command? I don't get an error exception if I call php artisan cron:run
from the laravel directory.
Cron tries to prevent overlapping by default. On windows machines, the created lock file cannot be deleted. This is a problem with the windows user management. So Cron thinks that still a Cron instance is running (because the cron.lock files is still there) and returns runtime -1
. So please disable the overlapping protection by calling Cron::setDisablePreventOverlapping();
before calling the run method or change the config value 'preventOverlapping' => false,
. Additionally please delete the cron.lock
file from your storage directory.
Thanks
Marc
from cron.
thanks very mush sir, it now work with me fine when i go to url path "/cron/run/sdasdasdawq2323123".
but when i make command "php artisan cron:run"
show me this below
+------------+---------+----------+--------+------+
| Run date | In time | Run time | Errors | Jobs |
+------------+---------+----------+--------+------+
| 1400204634 | false | 0 | 0 | 0 |
+------------+---------+----------+--------+------+
is this error ? becuase my cron function didn't work with this command, my cron function change in database, cron function work when i go to url path directly.
can you please explain steps to install and run "liebig/cron" in video, this will be very usefully ?
and the README.md didn't explain how to use cron key ?
sorry for my english language, it is not my native language
thanks very mush
from cron.
I forgot to tell you, that if you use the build in brand-new command, you have to use an event listener to add your jobs. The best place to do this is the /path/to/laravel/app/start/global.php
file.
/*
|--------------------------------------------------------------------------
| Cron job definitions
|--------------------------------------------------------------------------
*/
Event::listen('cron.collectJobs', function() {
Cron::add('example1', '* * * * *', function() {
// Do some crazy things unsuccessfully every minute
return 'No';
});
Cron::add('example2', '*/2 * * * *', function() {
// Do some crazy things successfully every two minute
return null;
});
Cron::add('disabled job', '0 * * * *', function() {
// Do some crazy things successfully every hour
}, false);
});
Inside the anonymous function you can use all the Laravel and Cron functionality. This feature is really new and I am rewriting the README file at the moment. I will update it soon. If you use this event listener, you can delete your created route. Please let me know if this works. Thank you.
from cron.
show me this error
C:\xampp\htdocs\lara>php artisan cron:run
[ErrorException]
Missing argument 1 for {closure}()
cron:run
when i remove "$rundate" parameter work with me with this output
C:\xampp\htdocs\lara>php artisan cron:run
+------------+---------+----------+--------+------+
| Run date | In time | Run time | Errors | Jobs |
+------------+---------+----------+--------+------+
| 1400247245 | false | 0.0803 | 1 | 1 |
+------------+---------+----------+--------+------+
from cron.
I am sorry, you are right. There is no $rundate
value anymore. That is the problem with brand new features. They are not fully tested.
from cron.
please tell me when problem solved.
thanks sir
from cron.
Which problem do you mean? The command works fine without the rundate parameter?
from cron.
you means i must remove $rundate parameter to command work ?
but when i run this command show me 1 Error in below table ?
What does this error mean ?
C:\xampp\htdocs\lara>php artisan cron:run
+------------+---------+----------+--------+------+
| Run date | In time | Run time | Errors | Jobs |
+------------+---------+----------+--------+------+
| 1400247245 | false | 0.0803 | 1 | 1 |
+------------+---------+----------+--------+------+
thanks
from cron.
This error means, that the Cron job you ran did not return null. In my example at the top, the Cron job with the name "example1" returns "No". This is not null and Crons expects that there was an error executing this job. With this feature you can log and handle error jobs. This is only an example and if there was no error while executing the job, you should return NULL.
from cron.
thanks you
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.