SQLite: Reduce worker limit to 4 to prevent locking #680 #558 #392

This commit is contained in:
Michael Mayer 2020-12-07 16:20:35 +01:00
parent ae0af699c6
commit c466291405

View file

@ -266,8 +266,8 @@ func (c *Config) Workers() int {
numCPU := runtime.NumCPU()
// Limit number of workers when using SQLite to avoid database locking issues.
if c.DatabaseDriver() == SQLite && numCPU > 8 && c.params.Workers <= 0 {
return 8
if c.DatabaseDriver() == SQLite && numCPU > 4 && c.params.Workers <= 0 {
return 4
}
if c.params.Workers > 0 && c.params.Workers <= numCPU {