mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Add spaceIsDeleted checks
This commit is contained in:
parent
09387888de
commit
7e946d4313
9 changed files with 137 additions and 94 deletions
|
@ -117,7 +117,10 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) {
|
|||
}
|
||||
|
||||
lastConfiguration := s.configurationService.GetLast()
|
||||
var spaceIsClosed = &atomic.Bool{}
|
||||
var (
|
||||
spaceIsClosed = &atomic.Bool{}
|
||||
spaceIsDeleted = &atomic.Bool{}
|
||||
)
|
||||
getter := newCommonGetter(st.Id(), s.treeGetter, spaceIsClosed)
|
||||
syncStatus := syncstatus.NewNoOpSyncStatus()
|
||||
// this will work only for clients, not the best solution, but...
|
||||
|
@ -131,8 +134,8 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
headSync := headsync.NewHeadSync(id, s.config.SyncPeriod, st, peerManager, getter, syncStatus, log)
|
||||
objectSync := objectsync.NewObjectSync(id, peerManager, getter)
|
||||
headSync := headsync.NewHeadSync(id, spaceIsDeleted, s.config.SyncPeriod, st, peerManager, getter, syncStatus, log)
|
||||
objectSync := objectsync.NewObjectSync(id, spaceIsDeleted, peerManager, getter)
|
||||
sp := &space{
|
||||
id: id,
|
||||
objectSync: objectSync,
|
||||
|
@ -145,6 +148,7 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) {
|
|||
storage: st,
|
||||
treesUsed: &atomic.Int32{},
|
||||
isClosed: spaceIsClosed,
|
||||
isDeleted: spaceIsDeleted,
|
||||
}
|
||||
return sp, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue