@@ -34,9 +34,9 @@ export class NdnSvsAdaptor {
34
34
public syncAgent : SyncAgent ,
35
35
public readonly doc : Y . Doc ,
36
36
public readonly topic : string ,
37
- public readonly snapshotTopic : string = 'snapshot' ,
38
- public readonly snapshotFrequency : number = 10 ,
39
37
useBundler : boolean = false ,
38
+ public readonly snapshotInterval : number = 100 ,
39
+ public readonly snapshotTopic : string = 'snapshot' ,
40
40
) {
41
41
syncAgent . register ( 'update' , topic , ( content ) => this . handleSyncUpdate ( content ) ) ;
42
42
syncAgent . register ( 'blob' , snapshotTopic , ( content ) => this . handleSnapshotUpdate ( content ) ) ;
@@ -116,7 +116,7 @@ export class NdnSvsAdaptor {
116
116
count += seq ;
117
117
}
118
118
119
- if ( count % this . snapshotFrequency == 0 ) {
119
+ if ( count % this . snapshotInterval == 0 ) {
120
120
const encodedSV = Encoder . encode ( stateVector ) ;
121
121
122
122
// NOTE: The following code depend on snapshot naming convention to work.
@@ -130,7 +130,7 @@ export class NdnSvsAdaptor {
130
130
const content = Y . encodeStateAsUpdate ( this . doc ) ;
131
131
// its already in UInt8Array (binary), transporting currently without any additional encoding.
132
132
// use syncAgent's blob and publish mechanism
133
- await this . syncAgent . publishBlob ( 'snapshot' , content , snapshotName , true ) ;
133
+ await this . syncAgent . publishBlob ( this . snapshotTopic , content , snapshotName , true ) ;
134
134
135
135
// NOTE: The following code depend on snapshot naming convention to work.
136
136
// Verify this part if there's a change in naming convention.
0 commit comments