fix: add destructor in InfluxDbService

This commit is contained in:
Maël Gangloff
2025-10-07 19:55:19 +02:00
parent 3308dd35c4
commit 4409124ba8

View File

@@ -53,6 +53,7 @@ readonly class InfluxdbService
], (int) floor($info['start_time'] * 1e3),
WritePrecision::MS)
);
$this->client->close();
}
public function addDomainOrderPoint(Connector $connector, Domain $domain, bool $success): void
@@ -64,6 +65,7 @@ readonly class InfluxdbService
], [
'success' => $success,
]));
$this->client->close();
}
public function addDomainNotificationPoint(Domain $domain, TriggerAction $triggerAction, bool $success): void
@@ -75,6 +77,7 @@ readonly class InfluxdbService
], [
'success' => $success,
]));
$this->client->close();
}
private function writePoints(Point ...$points): void
@@ -89,10 +92,6 @@ readonly class InfluxdbService
} catch (\Throwable) {
// TODO: Add a retry mechanism if writing fails
}
}
protected function __destruct()
{
$this->client->close();
}
}