cnpm / cnpmjs.org

‼️ ‼️ ‼️ ‼️ DEPRECATED, please use https://github.com/cnpm/cnpmcore ‼️ ‼️ ‼️ ‼️
https://npmmirror.com
Other
3.55k stars 748 forks source link

【sync问题】SyncExpiredError #1719

Closed Aqiu007 closed 2 years ago

Aqiu007 commented 2 years ago

我使用的版本是2.14.3,根据查阅源码,发现是接口/-/all/since?stale=update_after&startkey=返回404,导致拿不到需要同步包,最后last_exist_sync_time一直没更新。 超过24h没有同步成功,触发了SyncExpiredError。 根据日志发现最近一次成功同步时间是北京时间2022-01-29 23:54:45,麻烦看下是不是接口/-/all/since?stale=update_after&startkey=做了什么调整?

Zian502 commented 2 years ago

新的镜像(cnpm/npmcore)不支持这个接口。你可以合并下这个代码看看: https://github.com/cnpm/cnpmjs.org/pull/1707

Aqiu007 commented 2 years ago

新的镜像(cnpm/npmcore)不支持这个接口。你可以合并下这个代码看看: #1707

合并之后,可以同步了 不过如果last_exist_sync_time存的是lastSeq,那么和当前时间计算时间差,就会一直超过24h,从而触发SyncExpiredError

lesliexlxiao commented 2 years ago

@Aqiu007 碰到同样的问题了

lesliexlxiao commented 2 years ago

@Zian502 已经合并了 https://github.com/cnpm/cnpmjs.org/pull/1707,如果不注释 sync/index.js 里面 checkSyncStatus 代码,否则一直会报 SyncExpiredError 错误,这块代码是否也要注释掉

Zian502 commented 2 years ago

你是要全量同步嘛还是,如果要全量同步就用新的镜像(cnpm/npmcore)搭建一个去全量同步老的

lesliexlxiao commented 2 years ago

我用的是 2.19.4 版本,合并了 https://github.com/cnpm/cnpmjs.org/pull/1707 代码。注释掉 sync/index.js 里面 checkSyncStatus 逻辑可以生效。想看下你们的方案的

Aqiu007 commented 2 years ago

你是要全量同步嘛还是,如果要全量同步就用新的镜像(cnpm/npmcore)搭建一个去全量同步老的

我不是同步全量,是同步exist的额