task-processor/cmd/main.go
2026-03-01 00:05:55 +03:00

33 lines
544 B
Go

package main
import (
"context"
log "github.com/sirupsen/logrus"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"syscall"
"task-processor/config"
"task-processor/internal/app"
"task-processor/internal/logging"
)
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer cancel()
c := config.NewConfig()
logging.LogSetup(c.LogLevel)
if c.PprofEnabled {
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
}
appl := app.New(c)
appl.Run(ctx)
}