fix(webhooks): increase timeout (#902)

* fix(webhooks): increase timeout

* feat: mockindexer add dummy webhook endpoint
This commit is contained in:
ze0s 2023-05-02 21:44:38 +02:00 committed by GitHub
parent de4a6c7661
commit c1746dc7d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 11 deletions

View file

@ -9,6 +9,7 @@ import (
"log"
"net/http"
"os"
"time"
"github.com/autobrr/autobrr/test/mockindexer/irc"
"github.com/go-chi/chi/v5"
@ -32,6 +33,11 @@ func main() {
r := chi.NewRouter()
r.Use(middleware.Logger)
r.Post("/webhook", func(w http.ResponseWriter, r *http.Request) {
time.Sleep(30 * time.Second)
w.WriteHeader(http.StatusOK)
})
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("<html><form method=\"POST\" action=\"/send\">Send an announce line to the channel<br><input style=\"width: 100%; margin-top: 5px; margin-bottom: 5px;\" name=\"line\" type=\"text\"><br><button type=\"submit\">Send to channel</button></form></html>"))
})