Skip to content

Commit

Permalink
change concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
starkwang committed Mar 17, 2016
1 parent c41330c commit 042927e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Spider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function Spider(userPageUrl, socket) {
.then(function(myFriends) {
return Promise.map(myFriends, function(myFriend) {
return getUser(myFriend.url);
}, { concurrency: 5 });
}, { concurrency: 3 });
})
.then(function(myFriends) {
var input = [];
Expand All @@ -30,7 +30,7 @@ function Spider(userPageUrl, socket) {
console.log(myFriends);
return Promise.map(myFriends, function(myFriend) {
return searchSameFriend(myFriend, myFriends, socket);
}, { concurrency: 5 });
}, { concurrency: 3 });
})
.then(function(result) {
var data = result;
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
cookie:'_za=c392e6c0-5bdb-4b01-a06d-84ffb9836a61; _ga=GA1.2.378714859.1433690880; _xsrf=44f011b01f29816fc257fae1770a9ece; q_c1=fb660ee5c15b4c97ae2b4b075373e5b6|1457189679000|1433392648000; udid="AIAAQIMSlAmPTohRXib_bmZtsg_JbPW-tC8=|1457502059"; cap_id="OTFiYmZkNjljYjA3NDc5Y2JhNzI1Yjc3YzMxMGZjNmU=|1458100835|fc17d10a2143b6851b98f66b367e7dfb0e16555f"; z_c0="QUFBQTFuTWRBQUFYQUFBQVlRSlZUV2RuRUZlZTh0amgwVjNEaktBVmhZNnNsQXdEa3FqUVVnPT0=|1458100839|d8b64b8c0f8ceb43765d44cb909e0367bcefec0c"; n_c=1; __utmt=1; __utma=51854390.1008998230.1458040825.1458107632.1458110980.7; __utmb=51854390.10.10.1458110980; __utmc=51854390; __utmz=51854390.1458102246.5.3.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmv=51854390.100-1|2=registration_date=20130824=1^3=entry_date=20130824=1',
cookie:'',
}
4 changes: 2 additions & 2 deletions fetchFollwerOrFollwee.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var fetchFollwerOrFollwee = function(options, socket) {
}
return Promise.map(offsets, function(offset) {
return getFollwerOrFollwee(user, offset, isFollowees, socket);
}, { concurrency: 5 }).then(function(array) {
}, { concurrency: 2 }).then(function(array) {
var result = [];
array.forEach(function(item) {
result = result.concat(item);
Expand Down Expand Up @@ -41,7 +41,7 @@ function getFollwerOrFollwee(user, offset, isFollowees, socket) {
'cache-control': 'no-cache',
'x-requested-with': 'XMLHttpRequest'
},
timeout: 3000
timeout: 1500
}, function(err, res, body) {
var tmp = [];
try {
Expand Down

0 comments on commit 042927e

Please sign in to comment.