From 03413cd11a10d0f42aa0e17871dd28f6b0710c01 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Tue, 13 Aug 2024 19:13:26 -0400 Subject: [PATCH] changed to mux so I can run sequentially. --- AniListUserFunctions.go | 5 +++-- MALUserFunctions.go | 5 +++-- SimklUserFunctions.go | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/AniListUserFunctions.go b/AniListUserFunctions.go index efdd728..4b3d422 100644 --- a/AniListUserFunctions.go +++ b/AniListUserFunctions.go @@ -69,8 +69,9 @@ func (a *App) AniListLogin() { } func handleAniListCallback(wg *sync.WaitGroup) { - srv := &http.Server{Addr: ":6734"} - http.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) { + mux := http.NewServeMux() + srv := &http.Server{Addr: ":6734", Handler: mux} + mux.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) { select { case <-aniCtxShutdown.Done(): fmt.Println("Shutting down...") diff --git a/MALUserFunctions.go b/MALUserFunctions.go index f1b112b..642d89d 100644 --- a/MALUserFunctions.go +++ b/MALUserFunctions.go @@ -116,8 +116,9 @@ func (a *App) MyAnimeListLogin() { } func handleMyAnimeListCallback(wg *sync.WaitGroup, verifier *CodeVerifier) { - srv := &http.Server{Addr: ":6734"} - http.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) { + mux := http.NewServeMux() + srv := &http.Server{Addr: ":6734", Handler: mux} + mux.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) { select { case <-myAnimeListCtxShutdown.Done(): fmt.Println("Shutting down...") diff --git a/SimklUserFunctions.go b/SimklUserFunctions.go index 33ea248..a720506 100644 --- a/SimklUserFunctions.go +++ b/SimklUserFunctions.go @@ -63,8 +63,9 @@ func (a *App) SimklLogin() { } func handleSimklCallback(wg *sync.WaitGroup) { - srv := &http.Server{Addr: ":6734"} - http.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) { + mux := http.NewServeMux() + srv := &http.Server{Addr: ":6734", Handler: mux} + mux.HandleFunc("/callback", func(w http.ResponseWriter, r *http.Request) { select { case <-simklCtxShutdown.Done(): fmt.Println("Shutting down...")