Skip to content

Commit

Permalink
Merge branch 'master' into normal-server
Browse files Browse the repository at this point in the history
  • Loading branch information
RPing committed Oct 21, 2017
2 parents 3f496a5 + 5bb26e1 commit acba741
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 6 additions & 7 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ function notify(projectPlatform, projectName, releasePage, results, cb) {

function checkAndNotify(results, projectInfo, projectName, projectPlatform, cb) {
if (needToNotify(results)) {
async.waterfall([
async.series([
function (inner_cb) {
const releasePage = site.siteUtil(projectPlatform).getReleasesPage(projectInfo)
notify(projectPlatform, projectName, releasePage, results, inner_cb)
}
], function waterfallCallback(hasSomeError) {
if (hasSomeError)
return cb(new Error(`failed: ${projectName}`))
], function seriesCallback(err) {
if (err)
cb(new Error(`failed: ${projectName}`))
})
}

cb(null, `success: ${projectName}`)
} else
cb(null, `success: ${projectName}`)
}

/*
Expand Down
3 changes: 2 additions & 1 deletion lib/sites/project/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Github {
}

getNewVersionInfo(check_date, project, cb) {
const req = request(`https://github.com/${project.project_author}/${project.project_name}/releases.atom`)
const url = `https://github.com/${project.project_author}/${project.project_name}/releases.atom`
const req = request(url, { timeout: 1500 })
const feedparser = new FeedParser({ addmeta: false })

const info = []
Expand Down
3 changes: 2 additions & 1 deletion lib/sites/project/pypi.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ class Pypi {

getNewVersionInfo(check_date, project, cb) {
const info = []
const url = `https://pypi.python.org/pypi/${project.project_name}/json`

request(`https://pypi.python.org/pypi/${project.project_name}/json`, (error, response, body) => {
request(url, { timeout: 3000 }, (error, response, body) => {
if (error)
return cb(error)

Expand Down

0 comments on commit acba741

Please sign in to comment.