Intoroduced concurrncy in filereading

This commit is contained in:
Simon Martens
2024-11-11 22:13:47 +01:00
parent 0aec995441
commit ce7795361a
3 changed files with 31 additions and 24 deletions

View File

@@ -35,17 +35,12 @@ func main() {
}
kgpz := app.NewKGPZ(cfg)
Bootstrap(kgpz)
kgpz.Init()
server := server.Start(kgpz, cfg)
Start(kgpz, server)
}
func Bootstrap(k *app.KGPZ) {
k.InitRepo()
k.Serialize()
}
func Start(k *app.KGPZ, s *server.Server) {
s.Start()
@@ -83,8 +78,7 @@ func Start(k *app.KGPZ, s *server.Server) {
fmt.Println("Pulling repo.")
k.Pull()
} else if input == "q" {
s := os.Signal(syscall.SIGTERM)
sigs <- s
sigs <- os.Signal(syscall.SIGTERM)
}
}
}()