| | |
| | | exit; |
| | | } |
| | | |
| | | use JVBase\managers\CustomTable; |
| | | use WP_Error; |
| | | use WP_REST_Request; |
| | | use WP_REST_Response; |
| | |
| | | |
| | | add_action('jvb_process_queue', [$this, 'checkQueue']); |
| | | add_action('jvb_queue_maintenance', [$this, 'maintenance']); |
| | | add_action('jvb_daily_snapshot', [$this->storage, 'snapshotDaily']); |
| | | |
| | | if (!wp_next_scheduled('jvb_process_queue')) { |
| | | wp_schedule_event(time(), 'every-minute', 'jvb_process_queue'); |
| | |
| | | if (!wp_next_scheduled('jvb_queue_maintenance')) { |
| | | wp_schedule_event(time(), 'hourly', 'jvb_queue_maintenance'); |
| | | } |
| | | if (!wp_next_scheduled('jvb_daily_snapshot')) { |
| | | // Schedule for next 3am |
| | | $next3am = strtotime('tomorrow 3am', current_time('timestamp')); |
| | | wp_schedule_event($next3am, 'daily', 'jvb_daily_snapshot'); |
| | | } |
| | | |
| | | jvb_register_do_once('queue_admin_action_registered', [$this, 'registerAdminAction']); |
| | | add_filter(BASE.'admin_action_filter', [$this, 'adminActionFilter'], 10, 3); |