fix(server): reduce kill delay and implement port retry mechanism

- Changed the kill delay from 30 seconds to 2 seconds in the configuration.
- Refactored the server startup process to include a retry mechanism for binding to the port, addressing potential issues during hot-reload scenarios.
- Added a new function, listenWithRetry, to handle port binding with exponential backoff, improving server reliability during restarts.
This commit is contained in:
wizardchen
2026-03-23 01:35:09 +08:00
committed by lyingbug
parent 0bb1a581de
commit 109393dd16
2 changed files with 32 additions and 5 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ tmp_dir = "tmp"
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html", "yaml"]
include_file = []
kill_delay = "30s"
kill_delay = "2s"
log = "build-errors.log"
poll = false
poll_interval = 0