summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-05-07 22:49:00 +0100
committerGitHub <noreply@github.com>2020-05-07 22:49:00 +0100
commit791353c03ba81d1c67393a04256a77293307ecad (patch)
treeb0771f7e1683db318c5e5606a312319578392dcd /modules/setting/setting.go
parent486e4c8087746ca91c05a693cadd563ac061a913 (diff)
downloadgitea-791353c03ba81d1c67393a04256a77293307ecad.tar.gz
gitea-791353c03ba81d1c67393a04256a77293307ecad.zip
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
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index bf2ed6111e..de0f5cbad2 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -182,9 +182,10 @@ var (
UseServiceWorker bool
Notification struct {
- MinTimeout time.Duration
- TimeoutStep time.Duration
- MaxTimeout time.Duration
+ MinTimeout time.Duration
+ TimeoutStep time.Duration
+ MaxTimeout time.Duration
+ EventSourceUpdateTime time.Duration
} `ini:"ui.notification"`
Admin struct {
@@ -216,13 +217,15 @@ var (
Themes: []string{`gitea`, `arc-green`},
Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`},
Notification: struct {
- MinTimeout time.Duration
- TimeoutStep time.Duration
- MaxTimeout time.Duration
+ MinTimeout time.Duration
+ TimeoutStep time.Duration
+ MaxTimeout time.Duration
+ EventSourceUpdateTime time.Duration
}{
- MinTimeout: 10 * time.Second,
- TimeoutStep: 10 * time.Second,
- MaxTimeout: 60 * time.Second,
+ MinTimeout: 10 * time.Second,
+ TimeoutStep: 10 * time.Second,
+ MaxTimeout: 60 * time.Second,
+ EventSourceUpdateTime: 10 * time.Second,
},
Admin: struct {
UserPagingNum int