2
0
Files
gitcaddy-runner/main.go
logikonline b2922e332a feat(i18n): add windows service support and graceful shutdown
- Add native Windows service detection and signal handling
- Implement configurable shutdown timeout for graceful job completion
- Improve HTTP client with connection pooling and timeouts
- Propagate context through poller for proper shutdown coordination
- Add documentation for Windows service installation (NSSM and sc.exe)
- Add *.exe to .gitignore for Windows builds
2026-01-25 11:40:30 -05:00

31 lines
737 B
Go

// Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package main
import (
"context"
"os/signal"
"syscall"
"git.marketally.com/gitcaddy/gitcaddy-runner/internal/app/cmd"
"git.marketally.com/gitcaddy/gitcaddy-runner/internal/pkg/service"
)
func main() {
// Check if running as Windows service
if service.IsWindowsService() {
// Run as Windows service with proper SCM handling
_ = service.RunAsService(service.GetServiceName(), func(ctx context.Context) {
cmd.Execute(ctx)
})
return
}
// Normal interactive mode with signal handling
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()
// run the command
cmd.Execute(ctx)
}