Implemented server sent events

This commit is contained in:
2018-11-07 05:40:03 +09:00
parent 61454b3e5b
commit e56782d5a3
6 changed files with 81 additions and 1 deletions

View File

@ -76,7 +76,7 @@ func logRequest(ctx *aero.Context, responseTime time.Duration) {
// Notify us about long requests.
// However ignore requests under /auth/ because those depend on 3rd party servers.
if responseTime >= 300*time.Millisecond && !strings.HasPrefix(ctx.URI(), "/auth/") && !strings.HasPrefix(ctx.URI(), "/sitemap/") {
if responseTime >= 300*time.Millisecond && !strings.HasPrefix(ctx.URI(), "/auth/") && !strings.HasPrefix(ctx.URI(), "/sitemap/") && !strings.HasPrefix(ctx.URI(), "/api/sse/") {
errorLog.Error("Long response time", nick, id, ip, responseTimeString, ctx.StatusCode, ctx.URI())
}
}