Support » Plugin: WP Crontrol » Different results on schedule and manually started cron

  • When the script is executed on schedule does not load all the rows from the db table. But if we start the script via “Run Now” (from the admin panel) the script loads all the rows. There are no errors (we have debug ON). The script is the same but just does not work correctly when is run by the schedule. Can we debug the cron errors somehow?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • P.S. Which php is used on scheduled scripts? Is it different from the “run now” php?

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Run now triggers the same mechanism that’s used for the actual cron system in WordPress.

    What does your cron event callback code look like?

    The code is quite complex. The script gets a lot of rows from a external DB table, and then loads the wp tables with the rows. The thing is, if the rows that has to be inserted in the wp tables are 100 or 500, everything works. But if the rows to be inserted are more than 1000, then the script just not inserting all of them. No error returned.

    I tried to increase the run time of the cron scripts, by putting this line in wp-config:
    define(‘WP_CRON_LOCK_TIMEOUT’, 3600);
    No luck.

    Is there a way I can increase the limit of the time of the scripts run? I think that now, the time is too short, and not all rows are inserted.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    In your initial report you mentioned loading rows from the table, not inserting them. That’s a different problem and most likely caused by a memory or timeout issue.

    You should take a look in your PHP error log to see if there are any fatal errors.

    Events that run via the Run Now action run in exactly the same manner as they do when they run via their schedule.

    The cron event system in WordPress explicitly removes the timeout when running events.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.