1 | <?php |
||
9 | class RunManager |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $runClass; |
||
13 | |||
14 | 42 | public function __construct($runClass) |
|
18 | |||
19 | /** |
||
20 | * @return string |
||
21 | */ |
||
22 | 20 | public function getRunClass() |
|
26 | |||
27 | /** |
||
28 | * @param string $runClass |
||
29 | */ |
||
30 | 1 | public function setRunClass($runClass) |
|
34 | |||
35 | /** |
||
36 | * @param \DateTime $olderThan |
||
37 | * |
||
38 | * @return int Number of archived runs pruned |
||
39 | * |
||
40 | * @throws UnsupportedException |
||
41 | */ |
||
42 | 1 | public function pruneArchivedRuns(\DateTime $olderThan) |
|
46 | |||
47 | /** |
||
48 | * Prunes stalled runs. |
||
49 | * |
||
50 | * @return int Number of stalled runs pruned |
||
51 | * |
||
52 | * @throws UnsupportedException |
||
53 | */ |
||
54 | 1 | public function pruneStalledRuns() |
|
58 | |||
59 | /** |
||
60 | * @param float $start |
||
61 | * @param Job|null $job |
||
62 | */ |
||
63 | 3 | public function recordHeartbeat(Run $run, $start, Job $job = null) |
|
75 | |||
76 | /** |
||
77 | * @param Run $run |
||
78 | * @param string $action |
||
79 | */ |
||
80 | 3 | protected function persistRun(Run $run, $action = 'persist') |
|
84 | |||
85 | /** |
||
86 | * @param int $count |
||
87 | */ |
||
88 | 3 | public function updateProcessed(Run $run, $count) |
|
93 | |||
94 | /** |
||
95 | * Sets up the runManager (document / entity persister) if appropriate. |
||
96 | * |
||
97 | * @param float $start |
||
98 | * @param int|null $maxCount |
||
99 | * @param int|null $duration |
||
100 | * @param int $processTimeout |
||
101 | * |
||
102 | * @return Run |
||
103 | */ |
||
104 | 3 | public function runStart($start, $maxCount = null, $duration = null, $processTimeout = null) |
|
129 | |||
130 | /** |
||
131 | * @param Run $run |
||
132 | * @param int|null $start |
||
133 | */ |
||
134 | 3 | public function runStop(Run $run, $start) |
|
144 | } |
||
145 |