liquid_feedback_frontend

view app/main/_prefork/10_init.lua @ 1199:6b1f01c31092

Updated host config for Moonbridge 1.0
author bsw
date Tue Jun 23 19:48:56 2015 +0200 (2015-06-23)
parents 112a3add1637
children 30b3bf5db1bb
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 = 128
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 memory_limit = config.fork.memory_limit,
50 min_requests_per_fork = config.fork.min_requests,
51 max_requests_per_fork = config.fork.max_requests,
52 http_options = config.http_options
53 }
55 if config.ipv6 then
56 local host = config.localhost and "::1" or "::"
57 listen_options[#listen_options+1] = { proto = "tcp", host = host, port = config.port }
58 end
59 if config.ipv6 ~= "only" then
60 local host = config.localhost and "127.0.0.1" or "::"
61 listen_options[#listen_options+1] = { proto = "tcp", host = host, port = config.port }
62 end
64 listen(listen_options)
66 listen{
67 {
68 proto = "interval",
69 name = "send_pending_notifications",
70 delay = 5,
71 handler = function()
72 Event:send_pending_notifications()
73 end
74 },
75 min_fork = 1,
76 max_fork = 1
77 }
79 execute.inner()

Impressum / About Us