Allow to reset active db connection (#859)

resolves #805
This commit is contained in:
Johannes Meyer 2023-09-12 14:58:13 +02:00 committed by GitHub
commit cf957fbcdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,17 +22,14 @@ class Sni extends SniHook
*/
public function getHosts(Filter $filter = null): Generator
{
$queryHost = Host::on($this->getDb());
$this->getDb()->ping();
$queryHost->getSelectBase();
$hostStatusCols = [
'host_name' => 'name',
'host_address' => 'address',
'host_address6' => 'address6'
];
$queryHost = $queryHost->columns($hostStatusCols);
$queryHost = Host::on($this->getDb())
->columns([
'host_name' => 'name',
'host_address' => 'address',
'host_address6' => 'address6'
]);
$this->applyRestrictions($queryHost);