-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
50 lines (40 loc) · 969 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
46
47
48
49
50
package main
import (
"runtime"
"time"
"github.com/diamondburned/cchat-gtk/internal/gts"
"github.com/diamondburned/cchat-gtk/internal/log"
"github.com/diamondburned/cchat-gtk/internal/ui"
"github.com/diamondburned/cchat-gtk/internal/ui/config"
"github.com/diamondburned/cchat/services"
_ "github.com/diamondburned/cchat-discord"
)
func init() {
go func() {
// If you GC more, you have shorter STWs. Easy.
for range time.Tick(time.Minute) {
runtime.GC()
}
}()
}
func main() {
gts.Main(func() gts.MainApplication {
var app = ui.NewApplication()
// Load all cchat services.
srvcs, errs := services.Get()
if len(errs) > 0 {
for _, err := range errs {
log.Error(err)
}
}
// Add the services.
for _, srvc := range srvcs {
app.AddService(srvc)
}
// Restore the configs.
config.Restore()
// heapprofiler.Start("/tmp/cchat-gtk")
// gts.App.Window.Window.Connect("destroy", heapprofiler.Stop)
return app
})
}