This commit is contained in:
Toby Chui
2025-11-25 21:57:09 +08:00
parent e606c11631
commit 8976da8f7c
2 changed files with 11 additions and 3 deletions

View File

@@ -39,7 +39,6 @@ import (
"os/signal"
"strings"
"syscall"
"time"
"github.com/google/uuid"
"github.com/gorilla/csrf"
@@ -128,7 +127,9 @@ func main() {
ReverseProxyInit()
}()
time.Sleep(500 * time.Millisecond)
// Wait for dynamicProxyRouter to be initialized before proceeding
// See ReverseProxyInit() in reverseproxy.go
<-dynamicProxyRouterReady
//Start the finalize sequences
finalSequence()

View File

@@ -23,6 +23,7 @@ import (
var (
dynamicProxyRouter *dynamicproxy.Router
dynamicProxyRouterReady = make(chan bool, 1)
)
// Add user customizable reverse proxy
@@ -128,6 +129,12 @@ func ReverseProxyInit() {
}
dynamicProxyRouter = dprouter
// Signal that the router is ready
select {
case dynamicProxyRouterReady <- true:
default:
// Channel already has a value, skip
}
/*