aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-10-10 20:22:26 +0800
committerGitHub <noreply@github.com>2023-10-10 20:22:26 +0800
commit478e7042f5c4b4da9f72b11ee55a171e326a1603 (patch)
tree081eb77351f872ed34d82dbc9730c0e4d267817c /modules
parent63587a4aef69367fee28540e8e083af9b49c8035 (diff)
downloadgitea-478e7042f5c4b4da9f72b11ee55a171e326a1603.tar.gz
gitea-478e7042f5c4b4da9f72b11ee55a171e326a1603.zip
Increase queue length (#27555) (#27562)
Backport #27555 by @wolfogre It should be OK to increase the default queue length since the default type is "level". IMO, the old default length (100) is a little too small. See https://github.com/go-gitea/gitea/issues/27540#issuecomment-1754269491 IIRC, a larger length could lead to more memory usage only when the type is "channel," but it's an obscure case. Otherwise, it's just a limit (for "level" or "redis"). Co-authored-by: Jason Song <i@wolfogre.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/queue/manager_test.go2
-rw-r--r--modules/setting/queue.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/queue/manager_test.go b/modules/queue/manager_test.go
index 9a5b616b1a..15dd1b4f2f 100644
--- a/modules/queue/manager_test.go
+++ b/modules/queue/manager_test.go
@@ -46,7 +46,7 @@ CONN_STR = redis://
assert.Equal(t, "default", q.GetName())
assert.Equal(t, "level", q.GetType())
assert.Equal(t, filepath.Join(setting.AppDataPath, "queues/common"), q.baseConfig.DataFullDir)
- assert.Equal(t, 100, q.baseConfig.Length)
+ assert.Equal(t, 100000, q.baseConfig.Length)
assert.Equal(t, 20, q.batchLength)
assert.Equal(t, "", q.baseConfig.ConnStr)
assert.Equal(t, "default_queue", q.baseConfig.QueueFullName)
diff --git a/modules/setting/queue.go b/modules/setting/queue.go
index fc15bd07ed..251a6c1e30 100644
--- a/modules/setting/queue.go
+++ b/modules/setting/queue.go
@@ -30,7 +30,7 @@ func GetQueueSettings(rootCfg ConfigProvider, name string) (QueueSettings, error
queueSettingsDefault := QueueSettings{
Type: "level", // dummy, channel, level, redis
Datadir: "queues/common", // relative to AppDataPath
- Length: 100, // queue length before a channel queue will block
+ Length: 100000, // queue length before a channel queue will block
QueueName: "_queue",
SetName: "_unique",