File: init.lua

package info (click to toggle)
golang-github-centrifugal-centrifuge 0.15.0%2Bgit20210306.f435ba2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,612 kB
  • sloc: javascript: 102; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 809 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'strict'.on()
fiber = require 'fiber'

local instance_id = string.match(arg[1], '^%d+$')
assert(instance_id, 'malformed instance id')

local port = 3300 + instance_id
local workdir = 'tnt'..instance_id

box.cfg{
    listen = '0.0.0.0:'..port,
    wal_mode = 'none',
    wal_dir = workdir, -- though WAL used here by default, see above.
    memtx_dir = workdir,
    readahead = 10 * 1024 * 1024, -- to keep up with benchmark load.
    net_msg_max = 1024, -- to keep up with benchmark load.
}
box.schema.user.grant('guest', 'super', nil, nil, { if_not_exists = true })

centrifuge = require 'centrifuge'

box.once("centrifuge:schema:1", function()
    centrifuge.init({
        presence_temporary=true
    })
end)

if not fiber.self().storage.console then
    require'console'.start()
    os.exit()
end