mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: add destructor in InfluxDbService
This commit is contained in:
@@ -53,6 +53,7 @@ readonly class InfluxdbService
|
|||||||
], (int) floor($info['start_time'] * 1e3),
|
], (int) floor($info['start_time'] * 1e3),
|
||||||
WritePrecision::MS)
|
WritePrecision::MS)
|
||||||
);
|
);
|
||||||
|
$this->client->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addDomainOrderPoint(Connector $connector, Domain $domain, bool $success): void
|
public function addDomainOrderPoint(Connector $connector, Domain $domain, bool $success): void
|
||||||
@@ -64,6 +65,7 @@ readonly class InfluxdbService
|
|||||||
], [
|
], [
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
]));
|
]));
|
||||||
|
$this->client->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addDomainNotificationPoint(Domain $domain, TriggerAction $triggerAction, bool $success): void
|
public function addDomainNotificationPoint(Domain $domain, TriggerAction $triggerAction, bool $success): void
|
||||||
@@ -75,6 +77,7 @@ readonly class InfluxdbService
|
|||||||
], [
|
], [
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
]));
|
]));
|
||||||
|
$this->client->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function writePoints(Point ...$points): void
|
private function writePoints(Point ...$points): void
|
||||||
@@ -89,10 +92,6 @@ readonly class InfluxdbService
|
|||||||
} catch (\Throwable) {
|
} catch (\Throwable) {
|
||||||
// TODO: Add a retry mechanism if writing fails
|
// TODO: Add a retry mechanism if writing fails
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected function __destruct()
|
|
||||||
{
|
|
||||||
$this->client->close();
|
$this->client->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user