-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.go
executable file
·45 lines (36 loc) · 1002 Bytes
/
main.go
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"github.com/quintans/maze"
"github.com/quintans/taskboard/go/impl"
"github.com/quintans/toolkit/log"
"runtime"
"runtime/debug"
"time"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
logger := log.LoggerFor("taskboad")
defer func() {
err := recover()
if err != nil {
logger.Errorf("%s\n%s\n", err, debug.Stack())
}
// give time for the loggers to write
time.Sleep(100 * time.Millisecond)
}()
var app = App{}
app.ContextFactory = impl.ContextFactory
app.Limit = impl.Limit
app.AuthenticationFilter = impl.AuthenticationFilter
app.ResponseBuffer = maze.ResponseBuffer
app.TransactionFilter = impl.TransactionFilter
app.LoginFilter = impl.LoginFilter
app.PingFilter = impl.PingFilter
app.Poll = impl.Poll
app.IpPort = impl.IpPort
appCtx := impl.NewAppCtx(nil, nil, nil, impl.TaskBoardService)
// service factory
app.JsonRpc = appCtx.BuildJsonRpcTaskBoardService(app.TransactionFilter)
app.ContentDir = impl.ContentDir
app.Start()
}