parent
aa257744f0
commit
68d84bdaa3
|
@ -66,12 +66,12 @@ func (handler *subscriptionHandler) handlePublish(w http.ResponseWriter, r *http
|
|||
return err
|
||||
}
|
||||
|
||||
handler.incStat(fmt.Sprintf("publish.%s", topic))
|
||||
// handler.incStat(fmt.Sprintf("publish.%s", topic))
|
||||
|
||||
if subs, e := handler.Subscribers[topic]; e {
|
||||
for _, sub := range subs {
|
||||
|
||||
handler.incStat(fmt.Sprintf("publish.post.%s.%s", topic, sub.Callback))
|
||||
// handler.incStat(fmt.Sprintf("publish.post.%s.%s", topic, sub.Callback))
|
||||
log.Printf("publish: creating post to %s\n", sub.Callback)
|
||||
postReq, err := http.NewRequest("POST", sub.Callback, strings.NewReader(string(feedContent)))
|
||||
if err != nil {
|
||||
|
@ -264,7 +264,7 @@ func (handler *subscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
|||
if r.Method == http.MethodGet {
|
||||
fmt.Fprintln(w, "WebSub hub")
|
||||
if r.URL.Query().Get("debug") == "1" {
|
||||
handler.incStat("http.index.debug")
|
||||
// handler.incStat("http.index.debug")
|
||||
enc := json.NewEncoder(w)
|
||||
enc.SetIndent("", " ")
|
||||
enc.Encode(handler.Subscribers)
|
||||
|
|
Loading…
Reference in New Issue
Block a user