Add space deleted in storage
This commit is contained in:
parent
913c6925bf
commit
8a38d54192
@ -423,6 +423,10 @@ func (s *space) onObjectClose(id string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *space) onSpaceDelete() {
|
func (s *space) onSpaceDelete() {
|
||||||
|
err := s.storage.SetSpaceDeleted()
|
||||||
|
if err != nil {
|
||||||
|
log.Debug("failed to set space deleted")
|
||||||
|
}
|
||||||
s.isDeleted.Swap(true)
|
s.isDeleted.Swap(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -121,6 +121,11 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) {
|
|||||||
spaceIsClosed = &atomic.Bool{}
|
spaceIsClosed = &atomic.Bool{}
|
||||||
spaceIsDeleted = &atomic.Bool{}
|
spaceIsDeleted = &atomic.Bool{}
|
||||||
)
|
)
|
||||||
|
isDeleted, err := st.IsSpaceDeleted()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
spaceIsDeleted.Swap(isDeleted)
|
||||||
getter := newCommonGetter(st.Id(), s.treeGetter, spaceIsClosed)
|
getter := newCommonGetter(st.Id(), s.treeGetter, spaceIsClosed)
|
||||||
syncStatus := syncstatus.NewNoOpSyncStatus()
|
syncStatus := syncstatus.NewNoOpSyncStatus()
|
||||||
// this will work only for clients, not the best solution, but...
|
// this will work only for clients, not the best solution, but...
|
||||||
|
|||||||
@ -29,6 +29,8 @@ const (
|
|||||||
// TODO: consider moving to some file with all common interfaces etc
|
// TODO: consider moving to some file with all common interfaces etc
|
||||||
type SpaceStorage interface {
|
type SpaceStorage interface {
|
||||||
Id() string
|
Id() string
|
||||||
|
SetSpaceDeleted() error
|
||||||
|
IsSpaceDeleted() (bool, error)
|
||||||
SetTreeDeletedStatus(id, state string) error
|
SetTreeDeletedStatus(id, state string) error
|
||||||
TreeDeletedStatus(id string) (string, error)
|
TreeDeletedStatus(id string) (string, error)
|
||||||
SpaceSettingsId() string
|
SpaceSettingsId() string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user