mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:02:25 -05:00
[chore] move caches to a separate State{} structure (#1078)
* move caches to a separate State{} structure
Signed-off-by: kim <grufwub@gmail.com>
* fix call to log.Panic not using formatted call
Signed-off-by: kim <grufwub@gmail.com>
* move caches to use interfaces, to make switchouts easier in future
Signed-off-by: kim <grufwub@gmail.com>
* fix rebase issue
Signed-off-by: kim <grufwub@gmail.com>
* improve code comment
Signed-off-by: kim <grufwub@gmail.com>
* fix further issues after rebase
Signed-off-by: kim <grufwub@gmail.com>
* heh
Signed-off-by: kim <grufwub@gmail.com>
* add missing license text
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
dd1a4cd892
commit
e58d2d8122
27 changed files with 725 additions and 332 deletions
|
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/db/bundb"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/log"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/state"
|
||||
)
|
||||
|
||||
var testModels = []interface{}{
|
||||
|
|
@ -92,10 +93,16 @@ func NewTestDB() db.DB {
|
|||
})
|
||||
}
|
||||
|
||||
testDB, err := bundb.NewBunDBService(context.Background())
|
||||
var state state.State
|
||||
state.Caches.Init()
|
||||
|
||||
testDB, err := bundb.NewBunDBService(context.Background(), &state)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
state.DB = testDB
|
||||
|
||||
return testDB
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue