Skip to content

Commit

Permalink
fix: file descriptor leaks in WriteApi (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecsv authored Sep 29, 2021
1 parent 3f18155 commit 8f52ccc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 2.3.0 [unreleased]

### Bug Fixes
1. [#95](https://github.com/influxdata/influxdb-client-php/pull/95): Fix file descriptor leaks in WriteApi

## 2.2.0 [2021-09-17]

### Features
Expand Down
1 change: 1 addition & 0 deletions src/InfluxDB2/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function close()
foreach ($this->autoCloseable as $ac) {
$ac->close();
}
$this->autoCloseable = [];
}

public function getConfiguration()
Expand Down
6 changes: 5 additions & 1 deletion src/InfluxDB2/WriteApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ public function close()
{
$this->closed = true;

$this->worker()->flush();
if (isset($this->worker)) {
$this->worker()->flush();
}

unset($this->worker);
}

private function worker(): Worker
Expand Down

0 comments on commit 8f52ccc

Please sign in to comment.