Comments (6)
Hi @louposk,
I am sorry for the exception and I will try to help you. But first please tell me if you you use Laravel 4 or Laravel 5? Can you show me the complete Exception stack trace and can you tell me in which line the Exception is thrown?
Maybe there is a problem with the dependency injection if you call the application from command shell. Can you test Cron's integrated route and please test with curl: curl http://yourdomain.com/cron.php?key=yourSecurityKey > /dev/null 2>&1
.
Thanks,
Marc
from cron.
I am using laravel 4.
Where should i find the exception stack? In laravel logs, only get the cron log that says that there was an error. No other info.
Also, i dont have a cron security key. Should i add one?
Also, i try this in my localhost machine.
from cron.
I will try the route with curl and i will come back. Thanks
from cron.
You are right, there was no chance to get the stack trace. I changed this, so now Cron will log the full stack trace of an exception. Please update Cron to head and print the stack trace here.
For testing you can use a simple route like:
Route::get('/testCron', function() {
Cron::add('AddNewProducts', '* * * * *', function() {
$pr = App::make('ProductController')->addNewProducts();
var_dump($pr);
});
var_dump(Cron::run());
});
If this works, please generate a key and test with curl.
from cron.
Hi @liebig
the route works.
array (size=6)
'rundate' => int 1425550450
'inTime' => boolean false
'runtime' => float 78.723502159119
'errors' => int 0
'crons' =>
array (size=1)
0 =>
array (size=3)
'name' => string 'AddNewProducts' (length=14)
'return' => null
'runtime' => float 78.721502065659
'lastRun' =>
array (size=2)
'rundate' => string '2015-03-05 10:13:14' (length=19)
'runtime' => float 0.0099999997764826
So maybe the driver cannot be run from the artisan command line?
Also, the curl command works just fine
from cron.
That are great news. It seems that the Laravel IoC Container does not work properly if you call it from command line. So I would use the curl command to run Cron. Thank you for your reply.
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.