starter-kit/tomb.yaml
2025-05-21 12:39:40 +07:00

56 lines
1.3 KiB
YAML

# Tomb Configuration for ULFlow Starter Kit
# This file configures how our application handles signals and graceful shutdown
# Signal configuration
signals:
# Signal to use for graceful shutdown
graceful: "SIGTERM"
# Signal to use for forceful shutdown
force: "SIGKILL"
# Timeout for graceful shutdown before force shutdown
timeout: "10s"
# Hooks to execute during shutdown process
hooks:
# Pre-shutdown hooks run before beginning shutdown
pre_shutdown:
- name: "logger"
command: "go"
args: ["run", "./scripts/shutdown_logger.go", "pre"]
timeout: "2s"
async: true
# Shutdown hooks run during shutdown
shutdown:
- name: "close-http-server"
timeout: "5s"
async: false
# Post-shutdown hooks run after shutdown completes
post_shutdown:
- name: "cleanup"
command: "go"
args: ["run", "./scripts/shutdown_logger.go", "post"]
timeout: "2s"
async: true
# Resources to manage during shutdown
resources:
- name: "http-server"
type: "http"
grace_period: "5s"
- name: "database-connections"
type: "sql"
grace_period: "3s"
- name: "background-workers"
type: "worker"
grace_period: "8s"
# Monitoring configuration
monitoring:
enabled: true
interval: "1s"
threshold: 5 # number of consecutive failures before alerting