3namespace Bitrix\Im\V2\Common;
7 private static array $wasPeriodUpdated = [];
9 abstract protected static function isAgentPeriodShort(
int $newPeriod): bool;
11 protected static function setPeriodByName(
bool $fromAgent,
string $agentName, callable $periodGetter):
void
13 if (static::$wasPeriodUpdated[$agentName] ??
false)
18 $period = $periodGetter();
19 self::setPeriod($period, $fromAgent, $agentName);
20 static::$wasPeriodUpdated[$agentName] =
true;
23 protected static function setPeriod(
int $period,
bool $fromAgent,
string $agentName):
void
33 if (!self::isAgentPeriodShort($period))
38 $agent = \CAgent::GetList(
42 "=NAME" => $agentName,
46 if ($agent ===
false || $agent[
'ACTIVE'] ===
'Y')
53 [
'NEXT_EXEC' => \ConvertTimeStamp(time() + \CTimeZone::GetOffset() + $period,
'FULL')]
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)