0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Only try to update the Date field once every seconds.

This commit is contained in:
Loïc Hoguin 2011-05-14 18:50:43 +02:00
parent c7069e7fb9
commit 9f06bac7bf

View file

@ -65,7 +65,7 @@ init([]) ->
named_table, {read_concurrency, true}]), named_table, {read_concurrency, true}]),
T = erlang:universaltime(), T = erlang:universaltime(),
B = update_rfc1123(undefined, T, <<>>), B = update_rfc1123(undefined, T, <<>>),
{ok, TRef} = timer:send_interval(10, update), {ok, TRef} = timer:send_interval(1000, update),
ets:insert(?TABLE, {rfc1123, B}), ets:insert(?TABLE, {rfc1123, B}),
{ok, #state{universaltime=T, rfc1123=B, tref=TRef}}. {ok, #state{universaltime=T, rfc1123=B, tref=TRef}}.