liquid_feedback_frontend

view app/main/_prefork/10_init.lua @ 1168:3b00c08a6b90

merge
author jbe
date Tue Mar 24 19:34:03 2015 +0100 (2015-03-24)
parents 93b32111526f 51a17a0e26e9
children 112a3add1637
line source
1 if config.fork == nil then
2 config.fork = {}
3 end
5 if config.fork.pre == nil then
6 config.fork.pre = 2
7 end
9 if config.fork.min == nil then
10 config.fork.min = 4
11 end
13 if config.fork.max == nil then
14 config.fork.max = 8
15 end
17 if config.fork.delay == nil then
18 config.fork.delay = 0.125
19 end
21 if config.fork.error_delay == nil then
22 config.fork.error_delay = 2
23 end
25 if config.fork.exit_delay == nil then
26 config.fork.exit_delay = 2
27 end
29 if config.fork.idle_timeout == nil then
30 config.fork.idle_timeout = 900
31 end
33 if config.port == nil then
34 config.port = 8080
35 end
37 if config.localhost == nil then
38 config.localhost = true
39 end
41 local listen_options = {
42 pre_fork = config.fork.pre,
43 min_fork = config.fork.min,
44 max_fork = config.fork.max,
45 fork_delay = config.fork.delay,
46 fork_error_delay = config.fork.error_delay,
47 exit_delay = config.fork.exit_delay,
48 idle_timeout = config.fork.idle_timeout,
49 min_requests_per_fork = config.fork.min_requests,
50 max_requests_per_fork = config.fork.max_requests,
51 http_options = config.http_options
52 }
54 if config.ipv6 then
55 listen_options[#listen_options+1] = { proto = "tcp6", port = config.port, localhost = config.localhost }
56 end
57 if config.ipv6 ~= "only" then
58 listen_options[#listen_options+1] = { proto = "tcp4", port = config.port, localhost = config.localhost }
59 end
61 listen(listen_options)
63 listen{
64 {
65 proto = "interval",
66 name = "send_pending_notifications",
67 delay = 5,
68 handler = function()
69 Event:send_pending_notifications()
70 end
71 },
72 min_fork = 1,
73 max_fork = 1
74 }
76 execute.inner()

Impressum / About Us