Logo
Explore Help
Sign In
okooooooo/magpie
Watch 1
Star 0 Fork 0
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
5df609e525c10d0c02cc8acaba475fe49a0220ca
magpie/internal/gui/dev_handover_unix.go
T
yetone e0c6892f56 dev: a Go change hands the backend over instead of cutting the agents off (为什么老是会reconnecting) — make dev killed the backend, and the dev gateway with it, on every Go save, so Cindy's Pi on :3426 lost its stream and reconnected; now the new backend listens beside the old one (SO_REUSEPORT, dev only), and once it does the old one is sent USR2, stops taking requests, finishes those in flight — a stream as long as it takes — and exits. A backend that builds but never comes up leaves the old one serving. Tested in a sandbox: a 12s stream through the gateway ran to [DONE] across a handover, new requests went to the new backend, and the old one exited when the stream ended
2026-09-28 18:56:50 +08:00

13 lines
228 B
Go
Raw Blame History

//go:build dev && !windows
package gui
import (
"os"
"syscall"
)
// handoverSignal tells a dev backend its successor listens: USR2, so an
// INT or TERM still ends it at once.
var handoverSignal os.Signal = syscall.SIGUSR2
Reference in new issue View Git Blame Copy Permalink
Powered by Gitea Version: 28.3.0 Page: 48ms Template: 8ms
Auto
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API