1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 18:10:49 +09:00

GO-5344 Merge branch 'main' of github.com:anyproto/anytype-heart into go-5344-add-mention-counters

This commit is contained in:
Sergey 2025-04-03 11:00:51 +02:00
commit 3f913d9f97
No known key found for this signature in database
GPG key ID: 3B6BEF79160221C6
16 changed files with 258 additions and 164 deletions

View file

@ -77,6 +77,7 @@ func recursiveCleanup(path string, cutoff time.Time) {
info, err := entry.Info()
if err != nil {
log.Warnf("tmp cleanup entry: %v", err)
continue
}
if entry.IsDir() {
recursiveCleanup(fullEntryPath, cutoff)

View file

@ -7,6 +7,7 @@ import (
"os"
"path/filepath"
"sync"
"time"
anystore "github.com/anyproto/any-store"
"github.com/anyproto/any-store/anyenc"
@ -379,10 +380,12 @@ func (s *dsObjectStore) getOrInitSpaceIndex(spaceId string) spaceindex.Store {
func (s *dsObjectStore) getAnyStoreConfig() *anystore.Config {
return &anystore.Config{
Namespace: s.anyStoreConfig.Namespace,
ReadConnections: s.anyStoreConfig.ReadConnections,
SQLiteConnectionOptions: maps.Clone(s.anyStoreConfig.SQLiteConnectionOptions),
SyncPoolElementMaxSize: s.anyStoreConfig.SyncPoolElementMaxSize,
Namespace: s.anyStoreConfig.Namespace,
ReadConnections: s.anyStoreConfig.ReadConnections,
SQLiteConnectionOptions: maps.Clone(s.anyStoreConfig.SQLiteConnectionOptions),
SyncPoolElementMaxSize: s.anyStoreConfig.SyncPoolElementMaxSize,
StalledConnectionsDetectorEnabled: true,
StalledConnectionsPanicOnClose: time.Second * 30,
}
}
@ -430,6 +433,10 @@ func collectCrossSpace[T any](s *dsObjectStore, proc func(store spaceindex.Store
var result []T
for _, store := range stores {
err := store.Init()
if err != nil {
return nil, fmt.Errorf("init store: %w", err)
}
items, err := proc(store)
if err != nil {
return nil, err