Add EventSource support (#11235)

If the browser supports EventSource switch to use this instead of
polling notifications.

Signed-off-by: Andrew Thornton art27@cantab.net
This commit is contained in:
zeripath 2020-05-07 22:49:00 +01:00 committed by GitHub
parent 486e4c8087
commit 791353c03b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 676 additions and 27 deletions

View file

@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/modules/auth/sso"
"code.gitea.io/gitea/modules/cache"
"code.gitea.io/gitea/modules/cron"
"code.gitea.io/gitea/modules/eventsource"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/highlight"
code_indexer "code.gitea.io/gitea/modules/indexer/code"
@ -123,6 +124,7 @@ func GlobalInit(ctx context.Context) {
if err := task.Init(); err != nil {
log.Fatal("Failed to initialize task scheduler: %v", err)
}
eventsource.GetManager().Init()
}
if setting.EnableSQLite3 {
log.Info("SQLite3 Supported")