forked from contribsys/faktory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
daemon.go
41 lines (33 loc) · 838 Bytes
/
daemon.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
package main
import (
"fmt"
"github.com/contribsys/faktory/cli"
"github.com/contribsys/faktory/server"
"github.com/contribsys/faktory/util"
"github.com/contribsys/faktory/webui"
)
func main() {
opts := cli.ParseArguments()
// This takes over the default logger in `log` and gives us
// extra powers for adding fields, errors to log output.
util.InitLogger(opts.LogLevel)
util.Debug("Options", opts)
s, err := server.NewServer(&server.ServerOptions{
Binding: opts.Binding,
StorageDirectory: opts.StorageDirectory,
ConfigDirectory: opts.ConfigDirectory,
Environment: opts.Environment,
DisableTls: opts.DisableTls,
})
if err != nil {
fmt.Println(err)
return
}
webui.InitialSetup(s.Password)
go cli.HandleSignals(s)
err = s.Start()
if err != nil {
fmt.Println(err)
return
}
}