diff options
Diffstat (limited to 'internal/admin/middleware.go')
| -rw-r--r-- | internal/admin/middleware.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/admin/middleware.go b/internal/admin/middleware.go index 0dcf558..90560fa 100644 --- a/internal/admin/middleware.go +++ b/internal/admin/middleware.go @@ -1,17 +1,19 @@ package admin import ( - "fmt" + "log/slog" "net/http" ) // Hooks middleware to handle requests to the admin repo. func Hooks(adminSvc *Servicer, next http.Handler) http.Handler { - repoUpdatePath := fmt.Sprintf("/%s/git-receive-pack", mgmtRepoName) + repoUpdatePath := "/mgmt/git-receive-pack" return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { next.ServeHTTP(rw, req) + slog.Debug("hooks middleware", "url", req.URL.Path) if req.URL.Path == repoUpdatePath && req.Method == http.MethodPost { - adminSvc.Reload() + slog.Debug("hook firing reload") + go adminSvc.Reload() } }) } |