Initial commit
This commit is contained in:
30
cmd/service/main.go
Normal file
30
cmd/service/main.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/signal"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"marketlab/application"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
||||
defer cancel()
|
||||
|
||||
app, err := application.NewApplication(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
if err := app.Start(ctx, wg); err != nil {
|
||||
app.Logger.Fatal("startup", zap.Error(err))
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user