fix
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Bx\Discount\Agents;
|
||||
|
||||
use Wt\Core\Agent\AAgentCase;
|
||||
|
||||
class SpiderAgentManager extends AAgentCase
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAgentConfig()
|
||||
{
|
||||
return [
|
||||
'exec' => [
|
||||
'NEXT_EXEC' => $this->getNextExecLater(1),
|
||||
'MODULE_ID' => discountApp()->module()->getId(),
|
||||
'AGENT_INTERVAL' => 60,
|
||||
'IS_PERIOD' => 'Y',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public static function exec($arAgent)
|
||||
{
|
||||
ini_set('max_execution_time', 0);
|
||||
ini_set('memory_limit', -1);
|
||||
@set_time_limit(0);
|
||||
|
||||
|
||||
$agent = null;
|
||||
if (is_array($arAgent) && $arAgent['ID']) {
|
||||
$agent = app()->factory()->main()->getAgentFactory()->getEntityById($arAgent['ID']);
|
||||
}
|
||||
|
||||
$spider = discountApp()->service()->spider();
|
||||
$spider->setAgent($agent);
|
||||
$spider->next();
|
||||
|
||||
return static::class . "::exec(\$arAgent);";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user