This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/112965/ |
> Probably something is wrong here. It takes 3 seconds indeed; have you done any profiling to see where the time is being used?
server/lib/db/forum.js (Diff revision 1) | |||
---|---|---|---|
51 | categoryUrl = app.config.service.discourse.externalUrl + 'category/' + url.format(result.rows[0].categoryname+ '.json'); |
externalUrl; incorrect.
server/lib/db/forum.js (Diff revision 1) | |||
---|---|---|---|
102 | json.topics.push(topic); |
why push the topics here, just to pull them out again one-by-one later in findPost? that seems extremely inefficient. is there any reason why you can't simply fetch the post for the topic right here?
server/lib/db/forum.js (Diff revision 1) | |||
---|---|---|---|
105 | callback(err); |
why does it error if you run out of items in the array? it seems to me that this is a valid result: more posts were requested than exist, but that's not an error
server/lib/db/forum.js (Diff revision 1) | |||
---|---|---|---|
109 | (app.config.service.discourse.externalUrl + info.topic_list.more_topics_url) : null; |
externalUrl is wrong; bodega and discourse are not external to each other. this will cause the request to exit the local network and come back in through e.g.the load ballancer
server/lib/db/forum.js (Diff revision 1) | |||
---|---|---|---|
128 | var url = app.config.service.discourse.externalUrl + 't/' + topic.slug + '/' + topic.id + '.json'; |
externalUrl is wrong; bodega and discourse are not external to each other. this will cause the request to exit the local network and come back in through e.g.the load ballancer
server/lib/utils.js (Diff revision 1) | |||
---|---|---|---|
function done(err) { |
|||
340 | |||
341 | module.exports.get = function get(url, cb) { |
||
342 | request(url, function (error, response, body) { |
||
343 | if (!error && response.statusCode == 200) { |
||
344 | cb(null, JSON.parse(body)); |
||
345 | } else { |
||
346 | //FIXME |
||
347 | cb(error, null) |
||
348 | console.log(error); |
||
349 | } |
||
350 | }); |
||
351 | }; |
||
352 |
this is only used in forum.js, so put it there. util.js is for things that are used in more than one place.
- Aaron J.
On September 27th, 2013, 11:05 a.m. UTC, Giorgos Tsiapaliokas wrote:
Review request for Bodega.
By Giorgos Tsiapaliokas.
Updated Sept. 27, 2013, 11:05 a.m. Description
Testing
Diffs
|