| @@ 116-131 (lines=16) @@ | ||
| 113 | $all = $this->shouldWeGetAllIndex(); |
|
| 114 | $indexes = $this->indexService->getQueuedIndexes($all); |
|
| 115 | ||
| 116 | foreach ($indexes as $index) { |
|
| 117 | $this->runner->updateAction('indexing'); |
|
| 118 | ||
| 119 | try { |
|
| 120 | $provider = $this->providerService->getProvider($index->getProviderId()); |
|
| 121 | if (!$this->providerService->isProviderIndexed($provider->getId())) { |
|
| 122 | continue; |
|
| 123 | } |
|
| 124 | ||
| 125 | $this->indexService->updateDocument($platform, $provider, $index); |
|
| 126 | } catch (Exception $e) { |
|
| 127 | $this->runner->exception($e->getMessage(), false); |
|
| 128 | // TODO - upgrade error number - after too many errors, delete index |
|
| 129 | // TODO - do not count error if elasticsearch is down. |
|
| 130 | } |
|
| 131 | } |
|
| 132 | ||
| 133 | } |
|
| 134 | ||
| @@ 241-253 (lines=13) @@ | ||
| 238 | ||
| 239 | $indexes = $this->indexService->getQueuedIndexes(); |
|
| 240 | ||
| 241 | foreach ($indexes as $index) { |
|
| 242 | $this->runner->updateAction('indexing'); |
|
| 243 | ||
| 244 | try { |
|
| 245 | $provider = $this->providerService->getProvider($index->getProviderId()); |
|
| 246 | $provider->setRunner($this->runner); |
|
| 247 | $this->indexService->updateDocument($platform, $provider, $index); |
|
| 248 | } catch (Exception $e) { |
|
| 249 | $this->runner->exception($e->getMessage(), false); |
|
| 250 | // TODO - upgrade error number - after too many errors, delete index |
|
| 251 | // TODO - do not count error if elasticsearch is down. |
|
| 252 | } |
|
| 253 | } |
|
| 254 | ||
| 255 | $this->runner->updateAction('waiting', true); |
|
| 256 | ||