This repository was archived by the owner on Sep 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,11 @@ class Replicator extends EventEmitter {
107
107
}
108
108
}
109
109
110
+ stop ( ) {
111
+ //Clears the queue flusher
112
+ clearInterval ( this . _flushTimer )
113
+ }
114
+
110
115
_addToQueue ( entry ) {
111
116
const hash = entry . hash || entry
112
117
Original file line number Diff line number Diff line change @@ -150,6 +150,9 @@ class Store {
150
150
if ( this . options . onClose )
151
151
await this . options . onClose ( this . address . toString ( ) )
152
152
153
+ //Replicator teardown logic
154
+ this . _replicator . stop ( ) ;
155
+
153
156
// Reset replication statistics
154
157
this . _replicationStatus . reset ( )
155
158
@@ -438,7 +441,7 @@ class Store {
438
441
439
442
_recalculateReplicationProgress ( max ) {
440
443
this . _replicationStatus . progress = Math . max . apply ( null , [
441
- this . _replicationStatus . progress ,
444
+ this . _replicationStatus . progress ,
442
445
this . _oplog . length ,
443
446
max || 0 ,
444
447
] )
@@ -447,8 +450,8 @@ class Store {
447
450
448
451
_recalculateReplicationMax ( max ) {
449
452
this . _replicationStatus . max = Math . max . apply ( null , [
450
- this . _replicationStatus . max ,
451
- this . _oplog . length ,
453
+ this . _replicationStatus . max ,
454
+ this . _oplog . length ,
452
455
max || 0 ,
453
456
] )
454
457
}
You can’t perform that action at this time.
0 commit comments