fix(trigger): only send notifier when push=1/true; otherwise just return summary
This commit is contained in:
parent
7eea39310a
commit
cbd798dfd5
1 changed files with 3 additions and 1 deletions
|
|
@ -155,7 +155,9 @@ func (s *Server) handleTrigger(w http.ResponseWriter, r *http.Request) {
|
||||||
_, _ = w.Write([]byte("summarizer error"))
|
_, _ = w.Write([]byte("summarizer error"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if s.Notifier != nil {
|
// Only push if explicitly requested
|
||||||
|
pushFlag := strings.EqualFold(r.URL.Query().Get("push"), "1") || strings.EqualFold(r.URL.Query().Get("push"), "true")
|
||||||
|
if pushFlag && s.Notifier != nil {
|
||||||
title := fmt.Sprintf("IRC digest %s (%s)", channel, window)
|
title := fmt.Sprintf("IRC digest %s (%s)", channel, window)
|
||||||
_ = s.Notifier.Notify(ctx, title, summary)
|
_ = s.Notifier.Notify(ctx, title, summary)
|
||||||
if s.Metrics != nil {
|
if s.Metrics != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue