From 5fb1f4034677e6df886c5b0c3382b20b846ee4da Mon Sep 17 00:00:00 2001 From: arvindh123 Date: Fri, 24 Apr 2020 21:41:25 +0530 Subject: [PATCH] update --- src/mqtt2pgsql.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mqtt2pgsql.erl b/src/mqtt2pgsql.erl index e49f3bb..243f42c 100644 --- a/src/mqtt2pgsql.erl +++ b/src/mqtt2pgsql.erl @@ -61,7 +61,7 @@ on_message_publish(Message, Env) -> Values = string:join(["'" ++ mqtt2pgsql:cts(X) ++ "'" || X <- lists:map( fun(HeaderBin) -> maps:get(HeaderBin, PayloadMap) end,HeadersBin)], ","), Query = io_lib:format("INSERT INTO ~s.~s (~s) VALUES(~s) ~n", [mqtt2pgsql:cts(lists:nth(SchemaNo,Topic)), Table, Headers, Values] ), % io:format("Query - ~s~n", [Query]), - lists:nth(rand:uniform(length(PidNames)), PidNames) + % lists:nth(rand:uniform(length(PidNames)), PidNames) % mqtt2pgsql:write(list_to_atom(lists:flatten(io_lib:format("connection_~p", [rand:uniform(10)]))), Query, Env); mqtt2pgsql:write(lists:nth(rand:uniform(length(PidNames)), PidNames), Query, Env);