2025-10-02 20:35:53 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2026-02-28 10:53:02 +03:00
|
|
|
"context"
|
2026-02-28 23:33:37 +03:00
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
|
"net/http"
|
|
|
|
|
_ "net/http/pprof"
|
2026-02-28 10:53:02 +03:00
|
|
|
"os"
|
|
|
|
|
"os/signal"
|
|
|
|
|
"syscall"
|
2025-10-03 19:17:01 +03:00
|
|
|
"task-processor/config"
|
|
|
|
|
"task-processor/internal/app"
|
|
|
|
|
"task-processor/internal/logging"
|
2025-10-02 20:35:53 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2026-02-28 10:53:02 +03:00
|
|
|
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
|
|
|
|
defer cancel()
|
|
|
|
|
|
2025-10-02 20:35:53 +03:00
|
|
|
c := config.NewConfig()
|
|
|
|
|
|
|
|
|
|
logging.LogSetup(c.LogLevel)
|
|
|
|
|
|
2026-03-01 00:05:55 +03:00
|
|
|
if c.PprofEnabled {
|
2026-02-28 23:33:37 +03:00
|
|
|
go func() {
|
|
|
|
|
log.Println(http.ListenAndServe("localhost:6060", nil))
|
|
|
|
|
}()
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-02 20:35:53 +03:00
|
|
|
appl := app.New(c)
|
|
|
|
|
|
2026-02-28 10:53:02 +03:00
|
|
|
appl.Run(ctx)
|
2025-10-02 20:35:53 +03:00
|
|
|
}
|