Git Product home page Git Product logo

Comments (5)

liebig avatar liebig commented on July 4, 2024

Hi Troy,
Thanks for using Cron. The configuration logOnlyErrorJobsToDatabase only effects the cron_job table. Cron will always create an entry to the cron_manager table if the run command was called regardless of a job was executed or not (or a executed job returned an error or not). We need this to check if Cron is called in the correct time. If a Cron call was left behind you can be notified via listening to the cron.afterRun event with the $inTime parameter. So I hope you can live with this :) By the way you can delete old database entries with the method Cron::setDeleteDatabaseEntriesAfter($hours);.

Greetings
Marc

from cron.

tcarpenter2014 avatar tcarpenter2014 commented on July 4, 2024

Thanks, I will go ahead and leave database logging and shorten the default time for deleting database entries from 240 hours down to something like after 10 or 12 hours. Does deleting database entries include both the cron_job and cron_manager tables?

from cron.

liebig avatar liebig commented on July 4, 2024

Unfortunately this method deletes the entries for both tables. But with listening to the cron.jobError event you can save the error jobs to the database. So just create an own table for your error jobs and save them within the anonymous event function.

Event::listen('cron.jobError', function($name, $return, $runtime, $rundate){
    // Save the error job with the $name and the $return to the database
});

from cron.

tcarpenter2014 avatar tcarpenter2014 commented on July 4, 2024

Thanks for explaining this to me. It really helped a lot.

from cron.

liebig avatar liebig commented on July 4, 2024

You are welcome.

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.