summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-01-08 15:30:58 +0100
committerAntoine GIRARD <sapk@users.noreply.github.com>2020-01-08 15:30:58 +0100
commitc779ac12c971a4347d085f8dbca7531faab16221 (patch)
treeb666afa2692e48364393f2c94af70512342172e8 /modules/setting
parent98772d376c2a140d100f6ed9b09bfb63a3b817ca (diff)
downloadgitea-c779ac12c971a4347d085f8dbca7531faab16221.tar.gz
gitea-c779ac12c971a4347d085f8dbca7531faab16221.zip
fix #9648 | use filepath.IsAbs instead of path.IsAbs (#9651)
* fix #9648 * found next Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/queue.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/setting/queue.go b/modules/setting/queue.go
index 546802715f..c91ff55acd 100644
--- a/modules/setting/queue.go
+++ b/modules/setting/queue.go
@@ -7,6 +7,7 @@ package setting
import (
"fmt"
"path"
+ "path/filepath"
"strconv"
"strings"
"time"
@@ -44,7 +45,7 @@ func GetQueueSettings(name string) QueueSettings {
q := QueueSettings{}
sec := Cfg.Section("queue." + name)
// DataDir is not directly inheritable
- q.DataDir = path.Join(Queue.DataDir, name)
+ q.DataDir = filepath.Join(Queue.DataDir, name)
// QueueName is not directly inheritable either
q.QueueName = name + Queue.QueueName
for _, key := range sec.Keys() {
@@ -55,8 +56,8 @@ func GetQueueSettings(name string) QueueSettings {
q.QueueName = key.MustString(q.QueueName)
}
}
- if !path.IsAbs(q.DataDir) {
- q.DataDir = path.Join(AppDataPath, q.DataDir)
+ if !filepath.IsAbs(q.DataDir) {
+ q.DataDir = filepath.Join(AppDataPath, q.DataDir)
}
sec.Key("DATADIR").SetValue(q.DataDir)
// The rest are...
@@ -82,8 +83,8 @@ func GetQueueSettings(name string) QueueSettings {
func NewQueueService() {
sec := Cfg.Section("queue")
Queue.DataDir = sec.Key("DATADIR").MustString("queues/")
- if !path.IsAbs(Queue.DataDir) {
- Queue.DataDir = path.Join(AppDataPath, Queue.DataDir)
+ if !filepath.IsAbs(Queue.DataDir) {
+ Queue.DataDir = filepath.Join(AppDataPath, Queue.DataDir)
}
Queue.Length = sec.Key("LENGTH").MustInt(20)
Queue.BatchLength = sec.Key("BATCH_LENGTH").MustInt(20)