1 | <?php |
||
17 | class CleanupJob extends AbstractQueuedJob implements QueuedJob |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * How we will determine "stale" |
||
22 | * Possible values: age, number |
||
23 | * @config |
||
24 | * @var string |
||
25 | */ |
||
26 | private static $cleanup_method = "age"; |
||
|
|||
27 | |||
28 | /** |
||
29 | * Value associated with cleanupMethod |
||
30 | * age => days, number => integer |
||
31 | * @config |
||
32 | * @var integer |
||
33 | */ |
||
34 | private static $cleanup_value = 30; |
||
35 | |||
36 | /** |
||
37 | * Which JobStatus values are OK to be deleted |
||
38 | * @config |
||
39 | * @var array |
||
40 | */ |
||
41 | private static $cleanup_statuses = array( |
||
42 | "Complete", |
||
43 | "Broken", |
||
44 | // "Initialising", |
||
45 | // "Running", |
||
46 | // "New", |
||
47 | // "Paused", |
||
48 | // "Cancelled", |
||
49 | // "Waiting", |
||
50 | ); |
||
51 | |||
52 | /** |
||
53 | * Check whether is enabled or not for BC |
||
54 | * @config |
||
55 | * @var boolean |
||
56 | */ |
||
57 | private static $is_enabled = false; |
||
58 | |||
59 | /** |
||
60 | * Required because we aren't extending object |
||
61 | * @return Config_ForClass |
||
62 | */ |
||
63 | public function config() |
||
67 | |||
68 | /** |
||
69 | * Defines the title of the job |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getTitle() |
||
79 | |||
80 | /** |
||
81 | * Set immediacy of job |
||
82 | * @return int |
||
83 | */ |
||
84 | public function getJobType() |
||
89 | |||
90 | /** |
||
91 | * Clear out stale jobs based on the cleanup values |
||
92 | */ |
||
93 | public function process() |
||
157 | |||
158 | |||
159 | private function reenqueue() |
||
167 | } |
||
168 |
This check marks private properties in classes that are never used. Those properties can be removed.