Git Product home page Git Product logo

Comments (6)

liebig avatar liebig commented on June 26, 2024

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.

louposk avatar louposk commented on June 26, 2024

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.

louposk avatar louposk commented on June 26, 2024

I will try the route with curl and i will come back. Thanks

from cron.

liebig avatar liebig commented on June 26, 2024

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.

louposk avatar louposk commented on June 26, 2024

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.

liebig avatar liebig commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.