Skip to content

Commit

Permalink
fix: handle 201 response from write endpoint
Browse files Browse the repository at this point in the history
InfluxDB v3 returns 201 for partial write errors.
  • Loading branch information
jacobmarble committed Aug 13, 2024
1 parent 7bd9fb9 commit 7deef74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/impl/WriteApiImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ export default class WriteApiImpl implements WriteApi {
reject(error)
},
complete(): void {
// InfluxDB v3 returns 201 for partial success
// older implementations of transport do not report status code
if (responseStatusCode == 204 || responseStatusCode == undefined) {
if (responseStatusCode == 204 || responseStatusCode == 201 || responseStatusCode == undefined) {
self.writeOptions.writeSuccess.call(self, lines)
self.retryStrategy.success()
resolve()
Expand Down

0 comments on commit 7deef74

Please sign in to comment.