liquid_feedback_frontend

annotate app/main/_prefork/10_init.lua @ 1174:41c84e135844

merge
author jbe
date Tue Mar 24 23:44:30 2015 +0100 (2015-03-24)
parents 112a3add1637
children 6b1f01c31092
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@1169 14 config.fork.max = 128
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,
bsw@1169 49 memory_limit = config.fork.memory_limit,
jbe@1167 50 min_requests_per_fork = config.fork.min_requests,
jbe@1167 51 max_requests_per_fork = config.fork.max_requests,
jbe@1167 52 http_options = config.http_options
jbe@1167 53 }
jbe@1167 54
jbe@1167 55 if config.ipv6 then
jbe@1167 56 listen_options[#listen_options+1] = { proto = "tcp6", port = config.port, localhost = config.localhost }
jbe@1167 57 end
jbe@1167 58 if config.ipv6 ~= "only" then
jbe@1167 59 listen_options[#listen_options+1] = { proto = "tcp4", port = config.port, localhost = config.localhost }
jbe@1167 60 end
jbe@1167 61
jbe@1167 62 listen(listen_options)
jbe@1167 63
bsw@1158 64 listen{
jbe@1167 65 {
jbe@1167 66 proto = "interval",
jbe@1167 67 name = "send_pending_notifications",
jbe@1167 68 delay = 5,
jbe@1167 69 handler = function()
jbe@1167 70 Event:send_pending_notifications()
jbe@1167 71 end
jbe@1167 72 },
jbe@1167 73 min_fork = 1,
jbe@1167 74 max_fork = 1
bsw@1158 75 }
bsw@1158 76
bsw@1158 77 execute.inner()
bsw@1158 78

Impressum / About Us