diff options
author | zeripath <art27@cantab.net> | 2021-05-26 03:50:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-25 22:50:35 -0400 |
commit | c1a80b7d6aed36aebcae9b99f63336c758c0e2c4 (patch) | |
tree | e154a61118e2c67428aecdb095a242b17274e691 /modules/setting/queue.go | |
parent | b59afa272fbc0b77801754fc5ca810f8a613e7c8 (diff) | |
download | gitea-c1a80b7d6aed36aebcae9b99f63336c758c0e2c4.tar.gz gitea-c1a80b7d6aed36aebcae9b99f63336c758c0e2c4.zip |
Use filepath.ToSlash and Join in indexer defaults and queues (#15971)
As revealed by #15964 there is inconsistent use of filepath Join and path Join
for these directories. The best thing to do is to use filepath.Join but then ToSlash
them for consistency.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Diffstat (limited to 'modules/setting/queue.go')
-rw-r--r-- | modules/setting/queue.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/setting/queue.go b/modules/setting/queue.go index c626f585f0..41e95fbe5a 100644 --- a/modules/setting/queue.go +++ b/modules/setting/queue.go @@ -48,7 +48,7 @@ func GetQueueSettings(name string) QueueSettings { q.Name = name // DataDir is not directly inheritable - q.DataDir = filepath.Join(Queue.DataDir, "common") + q.DataDir = filepath.ToSlash(filepath.Join(Queue.DataDir, "common")) // QueueName is not directly inheritable either q.QueueName = name + Queue.QueueName for _, key := range sec.Keys() { @@ -91,9 +91,9 @@ func GetQueueSettings(name string) QueueSettings { // This is exported for tests to be able to use the queue func NewQueueService() { sec := Cfg.Section("queue") - Queue.DataDir = sec.Key("DATADIR").MustString("queues/") + Queue.DataDir = filepath.ToSlash(sec.Key("DATADIR").MustString("queues/")) if !filepath.IsAbs(Queue.DataDir) { - Queue.DataDir = filepath.Join(AppDataPath, Queue.DataDir) + Queue.DataDir = filepath.ToSlash(filepath.Join(AppDataPath, Queue.DataDir)) } Queue.QueueLength = sec.Key("LENGTH").MustInt(20) Queue.BatchLength = sec.Key("BATCH_LENGTH").MustInt(20) |