aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting/database.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2020-02-26 20:51:37 -0300
committerGitHub <noreply@github.com>2020-02-27 07:51:37 +0800
commit4a2d23981d39be8559757b54f0201adcba5496c3 (patch)
treedf7a3847585ed389c7965c0f8752bb79f42bc457 /modules/setting/database.go
parent7ffc2427daad725e448abfa1828b10acdba1a02c (diff)
downloadgitea-4a2d23981d39be8559757b54f0201adcba5496c3.tar.gz
gitea-4a2d23981d39be8559757b54f0201adcba5496c3.zip
Fix SQLite concurrency problems by using BEGIN IMMEDIATE (#10368)
* Test locking immediate for SQLite3 * fix url field separator Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'modules/setting/database.go')
-rw-r--r--modules/setting/database.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/setting/database.go b/modules/setting/database.go
index 911ac90a05..85043e8c11 100644
--- a/modules/setting/database.go
+++ b/modules/setting/database.go
@@ -126,7 +126,7 @@ func DBConnStr() (string, error) {
if err := os.MkdirAll(path.Dir(Database.Path), os.ModePerm); err != nil {
return "", fmt.Errorf("Failed to create directories: %v", err)
}
- connStr = fmt.Sprintf("file:%s?cache=shared&mode=rwc&_busy_timeout=%d", Database.Path, Database.Timeout)
+ connStr = fmt.Sprintf("file:%s?cache=shared&mode=rwc&_busy_timeout=%d&_txlock=immediate", Database.Path, Database.Timeout)
default:
return "", fmt.Errorf("Unknown database type: %s", Database.Type)
}