Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not added to cron_jobs? #24

Closed
gcphost opened this issue May 8, 2014 · 3 comments
Closed

not added to cron_jobs? #24

gcphost opened this issue May 8, 2014 · 3 comments
Assignees
Labels

Comments

@gcphost
Copy link

gcphost commented May 8, 2014

    Cron::add('testcron', '*/5 * * * *', function() {
        return null;
    }, true);
    Cron::setEnableJob('testcron');
    print_r(Cron::run());

Nothings added to the cron_jobs table, did I do something wrong?

@liebig
Copy link
Owner

liebig commented May 8, 2014

No, you did everything right. Your Cron job does not return an error (anything else then null), so it was not logged to database. Just add this before the run call and all jobs will be saved to database: Cron::setLogOnlyErrorJobsToDatabase(false);

@gcphost
Copy link
Author

gcphost commented May 8, 2014

Ah ok, was thinking it added the task to the database. Thanks!

@gcphost gcphost closed this as completed May 8, 2014
@liebig
Copy link
Owner

liebig commented May 8, 2014

You are welcome. But I agree that the default value "true" for log only error jobs to database is confusing. I will change this in the future.

@liebig liebig added the question label May 8, 2014
@liebig liebig self-assigned this May 8, 2014
liebig added a commit that referenced this issue May 13, 2014
…- by default all jobs should be logged - fixing issue #24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants