| @@ 118-126 (lines=9) @@ | ||
| 115 | * |
|
| 116 | * @return mixed |
|
| 117 | */ |
|
| 118 | public function countMessages() { |
|
| 119 | try { |
|
| 120 | $stats = msg_stat_queue($this->queue); |
|
| 121 | $this->logger->debug('Current message count: ' . json_encode($stats['msg_qnum']), ['app' => 'ocr']); |
|
| 122 | return $stats['msg_qnum']; |
|
| 123 | } catch (Exception $e) { |
|
| 124 | $this->handleException($e); |
|
| 125 | } |
|
| 126 | } |
|
| 127 | ||
| 128 | /** |
|
| 129 | * TODO: in the future this function could be used to give an admin information |
|
| @@ 134-142 (lines=9) @@ | ||
| 131 | * |
|
| 132 | * @return mixed |
|
| 133 | */ |
|
| 134 | public function countActiveProcesses() { |
|
| 135 | try { |
|
| 136 | $stats = msg_stat_queue($this->statusqueue); |
|
| 137 | $this->logger->debug('Current active processing count: ' . json_encode($stats['msg_qnum']), ['app' => 'ocr']); |
|
| 138 | return $stats['msg_qnum']; |
|
| 139 | } catch (Exception $e) { |
|
| 140 | $this->handleException($e); |
|
| 141 | } |
|
| 142 | } |
|
| 143 | ||
| 144 | /** |
|
| 145 | * Handle the possible thrown Exceptions from all methods of this class. |
|