[mirror] Scalable static site server for Git forges (like GitHub Pages)
1//go:build unix
2
3package git_pages
4
5import (
6 "os"
7 "os/signal"
8 "syscall"
9)
10
11func OnReload(handler func()) {
12 sighup := make(chan os.Signal, 1)
13 signal.Notify(sighup, syscall.SIGHUP)
14 go func() {
15 for {
16 <-sighup
17 handler()
18 }
19 }()
20}
21
22func WaitForInterrupt() {
23 sigint := make(chan os.Signal, 1)
24 signal.Notify(sigint, syscall.SIGINT)
25 <-sigint
26 signal.Stop(sigint)
27}