Sfoglia il codice sorgente

verify Fixed cowboy's db test

Mike Smith 11 anni fa
parent
commit
6a3550cd43
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      cowboy/src/db_handler.erl

+ 1 - 1
cowboy/src/db_handler.erl

@@ -22,7 +22,7 @@ handle(Req, State) ->
 			        {result_packet, _, _, [[ID, Rand]], _} <- [emysql:execute(test_pool, db_stmt, [random:uniform(10000)]) || _ <- lists:seq(1, I) ]],
 			{Res, Req1}
 		end,
-	{ok, Req3} = cowboy_req:reply(200, [{<<"Content-Type">>, <<"application/json">>}], jiffy:encode(JSON:sublist(L,1)), Req2),
+	{ok, Req3} = cowboy_req:reply(200, [{<<"Content-Type">>, <<"application/json">>}], jiffy:encode(lists:nth(1,JSON)), Req2),
 	{ok, Req3, State}.
 
 terminate(_Reason, _Req, _State) ->