forked from IAmRiteshKoushik/devpool.soc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
59 lines (47 loc) · 1.07 KB
/
main.go
File metadata and controls
59 lines (47 loc) · 1.07 KB
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
51
52
53
54
55
56
57
58
59
package main
import (
"log"
"os"
"sync"
"github.com/IAmRiteshKoushik/devpool/cmd"
"github.com/IAmRiteshKoushik/devpool/services"
)
func main() {
config, err := cmd.NewAppConfig()
if err != nil {
log.Fatalf("Failed to load app config: %v", err)
}
cmd.App = config
file, err := os.OpenFile("devpool.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("could not open log file: %v", err)
}
defer file.Close()
cmd.NewLogger(file)
if err := cmd.InitValkey(); err != nil {
cmd.Log.Fatal("Failed to initialize Valkey", err)
}
githubService, err := services.NewGithubService(config)
if err != nil {
cmd.Log.Fatal("Failed to initialize GithubService", err)
}
var wg sync.WaitGroup
wg.Add(4)
go func() {
defer wg.Done()
services.ConsumeIssueStream(githubService)
}()
go func() {
defer wg.Done()
services.ConsumeBountyStream(githubService)
}()
go func() {
defer wg.Done()
services.ConsumeSolutionStream(githubService)
}()
go func() {
defer wg.Done()
services.ConsumeAchievementsStream(githubService)
}()
wg.Wait()
}