|
14 | 14 | */ |
15 | 15 | class Connection extends DatabaseConnection { |
16 | 16 |
|
17 | | - /** |
18 | | - * Table to store jobs. |
19 | | - * |
20 | | - * @var string |
21 | | - */ |
22 | | - protected $jobs_table; |
23 | | - |
24 | | - /** |
25 | | - * Table to store failures. |
26 | | - * |
27 | | - * @var string |
28 | | - */ |
29 | | - protected $failures_table; |
30 | | - |
31 | 17 | /** |
32 | 18 | * Construct the Connection class. |
33 | 19 | * |
34 | 20 | * @param \wpdb $wpdb WordPress database class. |
35 | 21 | */ |
36 | | - public function __construct( $wpdb ) { |
37 | | - parent::__construct( $wpdb ); |
| 22 | + public function __construct( $wpdb, array $allowed_job_classes = array() ) { |
| 23 | + parent::__construct( $wpdb, $allowed_job_classes ); |
38 | 24 |
|
39 | 25 | $this->jobs_table = $this->database->base_prefix . 'oses_jobs'; |
40 | 26 | $this->failures_table = $this->database->base_prefix . 'oses_failures'; |
@@ -65,7 +51,7 @@ public function get_job( $id ) { |
65 | 51 | * |
66 | 52 | * @return bool |
67 | 53 | */ |
68 | | - public function release( $job ) { |
| 54 | + public function release( Job $job ) { |
69 | 55 | /** @var WP_Offload_SES $wp_offload_ses */ |
70 | 56 | global $wp_offload_ses; |
71 | 57 |
|
@@ -106,12 +92,12 @@ public function failure( $job, Exception $exception ): bool { |
106 | 92 | /** |
107 | 93 | * Push a job onto the queue. |
108 | 94 | * |
109 | | - * @param object $job The email job. |
110 | | - * @param int $delay The delay for the job. |
| 95 | + * @param Job $job The email job. |
| 96 | + * @param int $delay The delay for the job. |
111 | 97 | * |
112 | 98 | * @return bool|int |
113 | 99 | */ |
114 | | - public function push( \DeliciousBrains\WP_Offload_SES\WP_Queue\Job $job, $delay = 0 ) { |
| 100 | + public function push( Job $job, $delay = 0 ) { |
115 | 101 | $args = array( |
116 | 102 | 'job' => serialize( $job ), |
117 | 103 | 'available_at' => $this->datetime( $delay ), |
|
0 commit comments