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

Run Now often causes error #97

Open
robgilde opened this issue Mar 15, 2023 · 3 comments
Open

Run Now often causes error #97

robgilde opened this issue Mar 15, 2023 · 3 comments

Comments

@robgilde
Copy link

Found in 1.5.2.
Possibly related to Issue #33.
I stepped through this in a debugger and I think I've identified the root cause.

force_schedule_single_event() calls _set_cron_array()
_set_cron_array() calls update_option()
update_option() returns "true if the value was updated, false otherwise". False is not necessarily an error condition - it can be false if the save was unnecessary.
However, the false result is propagated back up and force_schedule_single_event() at line 108 treats it as an error.
I think line 108 should be something like if ( $wp_error && ! $result ) {

Thanks!

@johnbillion
Copy link
Owner

Thanks for the issue. I'll do some testing!

@johnbillion
Copy link
Owner

False is not necessarily an error condition - it can be false if the save was unnecessary

This is true, but in the case of force_schedule_single_event() the save is surely always necessary. In your debugging are you finding that the save inside update_option() doesn't happen?

@robgilde
Copy link
Author

Yes at line 485 I think $value === $old_value is true.
However I'm having some other problems at the moment and my dev env is hosed so I can't be certain that that is not an error.
Thanks for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants