aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_sup.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-05-14 15:20:12 +0200
committerLoïc Hoguin <[email protected]>2011-05-14 15:20:12 +0200
commit95006c3291fb4e359b09cd9b3986ba425484c9e9 (patch)
tree10206f82aa8101ce5482b79797e1c8f96a8e0b1c /src/cowboy_sup.erl
parent5d698250b228229001ca9966a390bf1545fcd0b0 (diff)
downloadcowboy-95006c3291fb4e359b09cd9b3986ba425484c9e9.tar.gz
cowboy-95006c3291fb4e359b09cd9b3986ba425484c9e9.tar.bz2
cowboy-95006c3291fb4e359b09cd9b3986ba425484c9e9.zip
Add the required Date header in the HTTP replies.
The formatted date is generated and kept up to date regularly by a gen_server process storing it in the cowboy_clock ets table. Then it is retrieved by other processes simply by reading the table.
Diffstat (limited to 'src/cowboy_sup.erl')
-rw-r--r--src/cowboy_sup.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cowboy_sup.erl b/src/cowboy_sup.erl
index e12b3aa..278df54 100644
--- a/src/cowboy_sup.erl
+++ b/src/cowboy_sup.erl
@@ -30,4 +30,6 @@ start_link() ->
-spec init([]) -> term(). %% @todo These specs should be improved.
init([]) ->
- {ok, {{one_for_one, 10, 10}, []}}.
+ Procs = [{cowboy_clock, {cowboy_clock, start_link, []},
+ permanent, 5000, worker, dynamic}],
+ {ok, {{one_for_one, 10, 10}, Procs}}.