Add reset() method for BanList

This commit is contained in:
Visman 2020-10-30 10:50:40 +07:00
parent de3df36af6
commit a333387636
3 changed files with 14 additions and 2 deletions

View file

@ -24,7 +24,7 @@ class Delete extends Method
WHERE id IN (?ai:ids)';
$this->c->DB->exec($query, $vars);
$this->model->load();
$this->model->reset();
}
return $this->model;

View file

@ -76,4 +76,16 @@ class Model extends ParentModel
return (isset($bin[4]) ? '' : '-') . \bin2hex($bin);
}
}
/**
* Сбрасывает кеш банов
*/
public function reset(): Model
{
if (true !== $this->c->Cache->delete('banlist')) {
throw new RuntimeException('Unable to remove key from cache - banlist');
}
return $this;
}
}

View file

@ -677,7 +677,7 @@ class Bans extends Admin
]);
}
$this->c->bans->load();
$this->c->bans->reset();
$redirect = $this->c->Redirect;