使用complete
复制时,仅local.replicate.from(remote)
不会触发paused
事件。正在指定{ live: false }
。
根据文档,当live
设置为false
时,我应该收到一个complete
事件。我的CouchDB服务器日志中没有任何我认为是错误的东西。
我正在使用pouch-browser
6.4.3
{
size: '1000',
adapter: 'idb',
auto_compaction: true,
revs_limit: 1
}
“拉”代码:
local.replicate.from(remote, {
live: false,
batch_size: 50,
batches_limit: 2,
timeout: 5000,
})
.on('change', this.onChange.bind(this))
.on('paused', this.onPause.bind(this))
.on('active', this.onActive.bind(this))
.on('denied', this.onDenied.bind(this))
.on('complete', this.onComplete.bind(this))
.on('error', this.onError.bind(this))
.catch(this.handleError.bind(this));
这将拉下所有远程记录,一切正常,没有complete
事件,只有paused
。好像指定了live: true
。
这是我的同步代码-这总是会触发complete
事件。 remote
变量中PouchDB的实例是配置为使用代理身份验证的CouchDB服务器-此身份验证似乎工作正常。
local.sync(remote, {
live: false,
batch_size: 50,
batches_limit: 2,
timeout: 5000,
})
.on('change', this.onChange.bind(this))
.on('paused', this.onPause.bind(this))
.on('active', this.onActive.bind(this))
.on('denied', this.onDenied.bind(this))
.on('complete', this.onComplete.bind(this))
.on('error', this.onError.bind(this))
.catch(this.handleError.bind(this));
sync()方法始终会触发complete
事件,就像我期望的那样。 live: false
从来没有。
在这两种情况下为什么都没有收到local.replicate.from()
事件的任何想法吗?