Extract timing constants to constants package (gt-795e8)
Added 6 timing constants: - ShutdownNotifyDelay (500ms) - ClaudeStartTimeout (15s) - ShellReadyTimeout (5s) - DefaultDebounceMs (100) - DefaultDisplayMs (5000) - PollInterval (100ms) Updated 7 files to use these constants instead of magic numbers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/steveyegge/gastown/internal/constants"
|
||||
"github.com/steveyegge/gastown/internal/keepalive"
|
||||
"github.com/steveyegge/gastown/internal/polecat"
|
||||
"github.com/steveyegge/gastown/internal/tmux"
|
||||
@@ -547,7 +548,7 @@ func StopDaemon(townRoot string) error {
|
||||
}
|
||||
|
||||
// Wait a bit for graceful shutdown
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
time.Sleep(constants.ShutdownNotifyDelay)
|
||||
|
||||
// Check if still running
|
||||
if err := process.Signal(syscall.Signal(0)); err == nil {
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/steveyegge/gastown/internal/beads"
|
||||
"github.com/steveyegge/gastown/internal/constants"
|
||||
"github.com/steveyegge/gastown/internal/tmux"
|
||||
)
|
||||
|
||||
@@ -195,7 +196,7 @@ func (d *Daemon) executeLifecycleAction(request *LifecycleRequest) error {
|
||||
d.logger.Printf("Killed session %s for restart", sessionName)
|
||||
|
||||
// Wait a moment
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
time.Sleep(constants.ShutdownNotifyDelay)
|
||||
}
|
||||
|
||||
// Restart the session
|
||||
|
||||
Reference in New Issue
Block a user