changed to mux so I can run sequentially.

This commit is contained in:
John O'Keefe 2024-08-13 19:13:26 -04:00
parent fa3304db92
commit 03413cd11a
3 changed files with 9 additions and 6 deletions

View File

@ -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...")

View File

@ -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...")

View File

@ -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...")