fix nodes online
This commit is contained in:
parent
3f08fcb555
commit
e5b4f62e48
@ -3,11 +3,12 @@ package syncstatus
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/anyproto/any-sync/app"
|
|
||||||
"github.com/anyproto/any-sync/commonspace/spacestate"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/anyproto/any-sync/app"
|
||||||
|
"github.com/anyproto/any-sync/commonspace/spacestate"
|
||||||
|
|
||||||
"github.com/anyproto/any-sync/app/logger"
|
"github.com/anyproto/any-sync/app/logger"
|
||||||
"github.com/anyproto/any-sync/commonspace/object/tree/treestorage"
|
"github.com/anyproto/any-sync/commonspace/object/tree/treestorage"
|
||||||
"github.com/anyproto/any-sync/commonspace/spacestorage"
|
"github.com/anyproto/any-sync/commonspace/spacestorage"
|
||||||
@ -178,8 +179,9 @@ func (s *syncStatusService) update(ctx context.Context) (err error) {
|
|||||||
}
|
}
|
||||||
s.treeStatusBuf = append(s.treeStatusBuf, treeStatus{treeId, treeHeads.syncStatus, treeHeads.heads})
|
s.treeStatusBuf = append(s.treeStatusBuf, treeStatus{treeId, treeHeads.syncStatus, treeHeads.heads})
|
||||||
}
|
}
|
||||||
|
nodesOnline := s.nodesOnline
|
||||||
s.Unlock()
|
s.Unlock()
|
||||||
s.updateReceiver.UpdateNodeConnection(s.nodesOnline)
|
s.updateReceiver.UpdateNodeConnection(nodesOnline)
|
||||||
for _, entry := range s.treeStatusBuf {
|
for _, entry := range s.treeStatusBuf {
|
||||||
err = s.updateReceiver.UpdateTree(ctx, entry.treeId, entry.status)
|
err = s.updateReceiver.UpdateTree(ctx, entry.treeId, entry.status)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user