diff --git a/apps/iot/src/influxdb/influx_client.erl b/apps/iot/src/influxdb/influx_client.erl index 8fa7c30..6f1e77a 100644 --- a/apps/iot/src/influxdb/influx_client.erl +++ b/apps/iot/src/influxdb/influx_client.erl @@ -140,18 +140,13 @@ handle_cast({write, Bucket, Org, Precision, Points}, State = #state{host = Host, lager:debug("[influx_client] url is: ~p, headers: ~p, body: ~ts", [Url, Headers, Body]), case hackney:request(post, Url, Headers, GZipBody, [{pool, influx_pool}]) of {ok, StatusCode, _RespHeaders, ClientRef} -> - case StatusCode >= 200 andalso StatusCode < 300 of - true -> - case hackney:body(ClientRef) of - {ok, RespBody} -> - lager:debug("[influx_client] status_code: ~p, response body is: ~p", [StatusCode, RespBody]); - {error, Error} -> - lager:warning("[influx_client] response error is: ~p", [Error]) - end; - false -> - lager:debug("[influx_client] status_code: ~p", [StatusCode]), - hackney:close(ClientRef) - end; + case hackney:body(ClientRef) of + {ok, RespBody} -> + lager:debug("[influx_client] status_code: ~p, response body is: ~p", [StatusCode, RespBody]); + {error, Error} -> + lager:warning("[influx_client] status_code: ~p, error is: ~p", [Error]) + end, + hackney:close(ClientRef); {error, Reason} -> lager:warning("[influx_client] request result is: ~p", [Reason]) end,