|
@@ -15,14 +15,22 @@ class FindBoxService
|
|
|
{
|
|
{
|
|
|
/** @var SQL $dbHandle */
|
|
/** @var SQL $dbHandle */
|
|
|
private $dbHandle;
|
|
private $dbHandle;
|
|
|
- private $findBoxCore;
|
|
|
|
|
|
|
+ private $findBoxCore = null;
|
|
|
private $labelToBlink;
|
|
private $labelToBlink;
|
|
|
|
|
|
|
|
public function __construct()
|
|
public function __construct()
|
|
|
{
|
|
{
|
|
|
global $f3;
|
|
global $f3;
|
|
|
$this->dbHandle = $f3->get('DB');
|
|
$this->dbHandle = $f3->get('DB');
|
|
|
- $this->findBoxCore = new FindBoxCoreSystem(...array_values($f3->get('CORE.fb')));
|
|
|
|
|
|
|
+ while ($this->findBoxCore == null)
|
|
|
|
|
+ try {
|
|
|
|
|
+ $this->findBoxCore = new FindBoxCoreSystem(...array_values($f3->get('CORE.fb')));
|
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
|
+ echo $this->getStrTime() . "Can't find FindBoxCore, retry in 1 second..\n";
|
|
|
|
|
+ ob_flush();
|
|
|
|
|
+ flush();
|
|
|
|
|
+ sleep(1);
|
|
|
|
|
+ }
|
|
|
$this->labelToBlink = [];
|
|
$this->labelToBlink = [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -112,7 +120,7 @@ class FindBoxService
|
|
|
$this->getCurrentQueue();
|
|
$this->getCurrentQueue();
|
|
|
|
|
|
|
|
//echo $this->getStrTime() . 'Label in cache: ' . count($this->labelToBlink) . " \n";
|
|
//echo $this->getStrTime() . 'Label in cache: ' . count($this->labelToBlink) . " \n";
|
|
|
- foreach($this->labelToBlink as $labelId => $label) {
|
|
|
|
|
|
|
+ foreach ($this->labelToBlink as $labelId => $label) {
|
|
|
|
|
|
|
|
// Priority 1
|
|
// Priority 1
|
|
|
// ----------
|
|
// ----------
|