add sync popular modules, close #468 #472

Merged
merged 2 commits into from Oct 13, 2014

Projects

None yet

2 participants

@dead-horse
Member
  • add sync popular modules
    • config.syncPopular
    • config.syncPopularInterval
    • topPopular
  • change ms to humanize-ms
@fengmk2 fengmk2 was assigned by dead-horse Oct 12, 2014
@dead-horse dead-horse added this to the 1.0 milestone Oct 12, 2014
@fengmk2 fengmk2 commented on the diff Oct 13, 2014
sync/index.js
+ logger.syncInfo('Start syncing popular modules...');
+ var data;
+ var error;
+ try {
+ data = yield *require('./sync_popular');
+ } catch (err) {
+ error = err;
+ error.message += ' (sync package error)';
+ logger.syncError(error);
+ }
+
+ if (data) {
+ logger.syncInfo(data);
+ }
+ if (!config.debug) {
+ sendMailToAdmin(error, data, new Date());
@fengmk2
fengmk2 Oct 13, 2014 Member

沒有錯誤還發郵件?

@dead-horse
dead-horse Oct 13, 2014 Member

可能会有同步失败的,但是没有错误。 sendMail 里面的逻辑会处理

@fengmk2 fengmk2 commented on the diff Oct 13, 2014
proxy/npm.js
registry: 'http://r.cnpmjs.org', // registry.npmjs.org/-/short is 404 now.
});
return r.data;
};
+
+exports.getPopular = function* (top, timeout) {
+ var r = yield *request('/-/_view/dependedUpon?group_level=1', {
@fengmk2
fengmk2 Oct 13, 2014 Member

we need to impl this api too?

@dead-horse
dead-horse Oct 13, 2014 Member

感觉可以等私有的搞定之后做个私有的,公共的可以直接代理到 NPM ?

@fengmk2
fengmk2 Oct 13, 2014 Member

嗯,有道理 +1
2014-10-13 上午11:52于 "Yiyu He" notifications@github.com写道:

In proxy/npm.js:

 registry: 'http://r.cnpmjs.org', // registry.npmjs.org/-/short is 404 now.

});
return r.data;
};
+
+exports.getPopular = function* (top, timeout) {

  • var r = yield *request('/-/_view/dependedUpon?group_level=1', {

感觉可以等私有的搞定之后做个私有的,公共的可以直接代理到 NPM ?


Reply to this email directly or view it on GitHub
https://github.com/cnpm/cnpmjs.org/pull/472/files#r18753302.

@fengmk2 fengmk2 added the enhancement label Oct 13, 2014
@fengmk2 fengmk2 merged commit 05c6d7b into master Oct 13, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@fengmk2 fengmk2 deleted the issue468-upon branch Oct 13, 2014
@fengmk2
Member
fengmk2 commented Oct 13, 2014

@dead-horse 你跟安琪給我的微信發一個數字: 396892 , 在線等...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment