admin: add warning about broken longpool

This commit is contained in:
veselcraft 2024-06-22 17:06:18 +03:00
parent bbbc8b7700
commit 3707ae0772
No known key found for this signature in database
GPG key ID: 9CF0B42766CCF7BA

View file

@ -49,6 +49,13 @@ final class AdminPresenter extends OpenVKPresenter
$this->flash("warn", tr("admin_commerce_disabled"), tr("admin_commerce_disabled_desc")); $this->flash("warn", tr("admin_commerce_disabled"), tr("admin_commerce_disabled_desc"));
} }
private function warnIfLongpoolBroken(): void
{
bdump(is_writable(CHANDLER_ROOT . '/tmp/events.bin'));
if(file_exists(CHANDLER_ROOT . '/tmp/events.bin') == false || is_writable(CHANDLER_ROOT . '/tmp/events.bin') == false)
$this->flash("warn", tr("admin_longpool_broken"), tr("admin_longpool_broken_desc", CHANDLER_ROOT . '/tmp/events.bin'));
}
private function searchResults(object $repo, &$count) private function searchResults(object $repo, &$count)
{ {
$query = $this->queryParam("q") ?? ""; $query = $this->queryParam("q") ?? "";
@ -76,7 +83,7 @@ final class AdminPresenter extends OpenVKPresenter
function renderIndex(): void function renderIndex(): void
{ {
$this->warnIfLongpoolBroken();
} }
function renderUsers(): void function renderUsers(): void