Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 17b67f2

Browse files
authored
Merge pull request #19 from orbitdb/feat/orbit-db-master
Fix replicationStatus and use OrbitDB from master
2 parents 267e6bc + 2645139 commit 17b67f2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/commands/info.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports.handler = (argv) => {
3232
process.stdout.write(`> Owner: ${db.id}\n`)
3333
process.stdout.write(`> Data file: ./${db._cache.path}\n`)
3434
process.stdout.write(`> Entries: ${db.type === 'counter' ? 1 : db._oplog.length}\n`)
35-
process.stdout.write(`> Oplog length: ${db._oplog.length} / ${db._replicationInfo.max}\n`)
35+
process.stdout.write(`> Oplog length: ${db._oplog.length} / ${db.replicationStatus.max}\n`)
3636
process.stdout.write(`> Write-access: \n> ${db.access.write.join('\n> ')}\n`)
3737
})
3838
.catch(exitOnError)

src/lib/replication-loop.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const replicate = (db, argv = {}) => {
2222
return new Promise((resolve, reject) => {
2323
if (argv.progress || jsonOutput) {
2424
const outputJson = (id, json = false) => {
25-
process.stdout.write(JSON.stringify({ id : id, progress: db._replicationInfo.progress, max: db._replicationInfo.max }))
25+
process.stdout.write(JSON.stringify({ id : id, progress: db.replicationStatus.progress, max: db.replicationStatus.max }))
2626
process.stdout.write('\n')
2727
}
2828

@@ -32,12 +32,12 @@ const replicate = (db, argv = {}) => {
3232
return
3333
}
3434

35-
outputProgress('Replicating', id, db._replicationInfo.progress, db._replicationInfo.max, startTime)
35+
outputProgress('Replicating', id, db.replicationStatus.progress, db.replicationStatus.max, startTime)
3636
}
3737

3838
db.events.on('replicate', (id) => {
39-
if (db._replicationInfo.max > latestProgress) {
40-
latestProgress = db._replicationInfo.max
39+
if (db.replicationStatus.max > latestProgress) {
40+
latestProgress = db.replicationStatus.max
4141
output(id)
4242
}
4343
})
@@ -52,7 +52,7 @@ const replicate = (db, argv = {}) => {
5252
})
5353

5454
if (argv.progress) {
55-
outputProgress('Replicating', db.address.toString(), db._replicationInfo.progress, db._replicationInfo.max, new Date().getTime())
55+
outputProgress('Replicating', db.address.toString(), db.replicationStatus.progress, db.replicationStatus.max, new Date().getTime())
5656
} else if (jsonOutput) {
5757
// Output nothing
5858
} else {

0 commit comments

Comments
 (0)