mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Use t.TempDir
for SQLite databases, so tests don't rip out each others databases (#2950)
This should hopefully finally fix issues about `disk I/O error` as seen [here](https://gitlab.alpinelinux.org/alpine/aports/-/jobs/955030/raw) Hopefully this will also fix `SSL accept attempt failed` issues by disabling HTTP keep alives when generating a config for CI.
This commit is contained in:
parent
430932f0f1
commit
48fa869fa3
8 changed files with 36 additions and 31 deletions
|
@ -24,6 +24,7 @@ import (
|
|||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/matrix-org/util"
|
||||
|
||||
|
@ -37,6 +38,7 @@ import (
|
|||
// this unfortunately results in us adding the same hook multiple times.
|
||||
// This map ensures we only ever add one level hook.
|
||||
var stdLevelLogAdded = make(map[logrus.Level]bool)
|
||||
var levelLogAddedMu = &sync.Mutex{}
|
||||
|
||||
type utcFormatter struct {
|
||||
logrus.Formatter
|
||||
|
|
|
@ -85,6 +85,8 @@ func checkSyslogHookParams(params map[string]interface{}) {
|
|||
}
|
||||
|
||||
func setupStdLogHook(level logrus.Level) {
|
||||
levelLogAddedMu.Lock()
|
||||
defer levelLogAddedMu.Unlock()
|
||||
if stdLevelLogAdded[level] {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue