Created
March 24, 2021 16:19
-
-
Save stuartnelson3/ddbf40dea8c49f0d0699f1ac481ac2ac to your computer and use it in GitHub Desktop.
trigger retries by responding with a retryable status code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
log.Println("got request") | |
w.WriteHeader(http.StatusServiceUnavailable) | |
w.Write([]byte("error")) | |
}) | |
log.Fatal(http.ListenAndServe(":9200", nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment