liquid_feedback_frontend

annotate app/main/_prefork/10_init.lua @ 1167:93b32111526f

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

Impressum / About Us