| Conditions | 8 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function process() |
||
| 19 | { |
||
| 20 | $bathCallback = fn (): bool => $this->checkTimeout() ? false : true; |
||
| 21 | foreach (App\Integrations\Comarch\Config::getAllServers() as $serverId => $config) { |
||
| 22 | if (0 == $config['status']) { |
||
| 23 | continue; |
||
| 24 | } |
||
| 25 | $this->updateLastActionTime(); |
||
| 26 | $connector = (new App\Integrations\Comarch($serverId, $bathCallback)); |
||
| 27 | if ($message = $connector->testConnection()) { |
||
| 28 | $this->addErrorLog($message); |
||
| 29 | continue; |
||
| 30 | } |
||
| 31 | foreach ([ |
||
| 32 | 'sync_accounts' => 'Accounts', |
||
| 33 | 'sync_products' => 'Products', |
||
| 34 | ] as $key => $value) { |
||
| 35 | if ($connector->config->get($key)) { |
||
| 36 | $connector->getSync($value)->process(); |
||
| 37 | } |
||
| 38 | if ($this->checkTimeout()) { |
||
| 39 | return; |
||
| 40 | } |
||
| 45 |