15 $expired->add(
'-1 days');
18 $tempFiles = TempFileTable::getList([
19 'filter' => [
'<CREATED_AT' => $expired->toString()],
21 'order' => [
'CREATED_AT' =>
'ASC']
22 ])->fetchCollection();
24 foreach ($tempFiles as $tempFile)
29 $agentName =
'\\' . __METHOD__ .
'();';
30 $agents = \CAgent::getList([
'ID' =>
'DESC'], [
35 if ($agent = $agents->fetch())
37 $interval = $tempFiles->count() < $limit ? static::AGENT_MAX_INTERVAL : static::AGENT_MIN_INTERVAL;
38 if ((
int)$agent[
'AGENT_INTERVAL'] !== $interval)
40 \CAgent::update($agent[
'ID'], [
'AGENT_INTERVAL' => $interval]);