mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: avoid sending error notifications if the problem is with the InfluxDB server
This commit is contained in:
@@ -79,11 +79,15 @@ readonly class InfluxdbService
|
||||
|
||||
private function writePoints(Point ...$points): void
|
||||
{
|
||||
$writeApi = $this->client->createWriteApi(['writeType' => WriteType::BATCHING, 'batchSize' => count($points)]);
|
||||
foreach ($points as $point) {
|
||||
$writeApi->write($point);
|
||||
}
|
||||
try {
|
||||
$writeApi = $this->client->createWriteApi(['writeType' => WriteType::BATCHING, 'batchSize' => count($points)]);
|
||||
foreach ($points as $point) {
|
||||
$writeApi->write($point);
|
||||
}
|
||||
|
||||
$writeApi->close();
|
||||
$writeApi->close();
|
||||
} catch (\Throwable) {
|
||||
// TODO: Add a retry mechanism if writing fails
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ readonly class StatService
|
||||
|
||||
return $this->pool->save($item);
|
||||
} catch (\Throwable) {
|
||||
// TODO: Add a retry mechanism if writing fails
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user