diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2018-10-31 20:43:05 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2018-10-31 20:43:05 +0300 |
commit | 2d027b159a1538ac1e650c7590e3e71284f6153d (patch) | |
tree | 5de4f2d499e1df6d34f84dd33cb14cdb14efc1d2 /lib | |
parent | b5fe0d8c4c41bf6dce5a8a99f6815736283a5da6 (diff) |
using InfoInt
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/RunningService.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Service/RunningService.php b/lib/Service/RunningService.php index aa953be..3fe35c4 100644 --- a/lib/Service/RunningService.php +++ b/lib/Service/RunningService.php @@ -78,7 +78,7 @@ class RunningService { $tick->setStatus('run') ->setTick() ->setFirstTick() - ->setInfo('runStart ', time()); + ->setInfoInt('runStart ', time()); return $this->tickRequest->create($tick); } @@ -129,12 +129,12 @@ class RunningService { * * @throws TickDoesNotExistException */ - public function stop($runId, $reason = '') { + public function stop(int $runId, string $reason = '') { $tick = $this->tickRequest->getTickById($runId); $tick->setStatus('stop') ->setTick() - ->setInfo('runStop', time()) - ->setInfo('totalDocuments', 42); + ->setInfoInt('runStop', time()) + ->setInfoInt('totalDocuments', 42); if ($reason !== '') { $tick->setStatus('exception'); @@ -187,7 +187,7 @@ class RunningService { * @return bool */ public function isAlreadyRunning() { - $ticks = $this->tickRequest->getTickByStatus('run'); + $ticks = $this->tickRequest->getTicksByStatus('run'); $isAlreadyRunning = false; foreach ($ticks as $tick) { @@ -207,7 +207,7 @@ class RunningService { * */ public function forceStop() { - $ticks = $this->tickRequest->getTickByStatus('run'); + $ticks = $this->tickRequest->getTicksByStatus('run'); foreach ($ticks as $tick) { $tick->setStatus('forceStop'); @@ -225,18 +225,18 @@ class RunningService { $preAction = $tick->getAction(); if ($preAction !== '') { - $preActionTotal = $tick->getInfo($preAction . 'Total', 0); - $preActionStart = $tick->getInfo($preAction . 'Init', 0); + $preActionTotal = $tick->getInfoInt($preAction . 'Total', 0); + $preActionStart = $tick->getInfoInt($preAction . 'Init', 0); if ($preActionStart > 0) { $preActionTotal += ($now - $preActionStart); - $tick->setInfo($preAction . 'Total', $preActionTotal); + $tick->setInfoInt($preAction . 'Total', $preActionTotal); $tick->unsetInfo($preAction . 'Init'); } } $tick->setAction($action) - ->setInfo($action . 'Init', $now); + ->setInfoInt($action . 'Init', $now); } |