Опрос тикетов по умолчанию каждые 3 с; пустой конфиг не отключает опрос

This commit is contained in:
root
2026-05-14 13:25:56 +00:00
parent b62c1bb7f3
commit 11e111d222
4 changed files with 10 additions and 6 deletions
+6 -2
View File
@@ -51,8 +51,12 @@ class PageController extends Controller {
$clientReadReceipts = $this->config->getAppValue('f7support', 'client_read_receipts', '0');
// Периодический GET /api/client/tickets (мс): has_unread и отпечаток карточки; WebSocket только у открытого тикета.
// 0 — отключить опрос. Иначе значение ограничивается 3000…120000. occ: f7support tickets_poll_ms
$ticketsPollMs = (int) $this->config->getAppValue('f7support', 'tickets_poll_ms', '3000');
// По умолчанию 3000 (3 с). Пустая строка в конфиге трактуется как 3000. Явное «0» отключает опрос. Иначе 3000…120000. occ: f7support tickets_poll_ms
$rawPoll = trim((string) $this->config->getAppValue('f7support', 'tickets_poll_ms', '3000'));
if ($rawPoll === '') {
$rawPoll = '3000';
}
$ticketsPollMs = (int) $rawPoll;
if ($ticketsPollMs < 0) {
$ticketsPollMs = 0;
} elseif ($ticketsPollMs > 0) {