I’m trying to setup a cron to run every hour, it works fine on my local vagrant box, but it doesn’t seem to schedule properly on aws(elastic beanstalk). Here’s the code:
register_activation_hook(__FILE__, 'my_activation');
add_action('my_hourly_event', 'do_this_hourly');
function my_activation() {
wp_schedule_event(time(), 'hourly', 'my_hourly_event');
}
function do_this_hourly() {
another_function();
}
register_deactivation_hook(__FILE__, 'my_deactivation');
function my_deactivation() {
wp_clear_scheduled_hook('my_hourly_event');
}
is something wrong with this, or is something else at play?
I have w3 total cache installed both locally and on aws, so I don’t think that would be to blame, as I’ve heard people mention it.
Thanks.