diff options
author | Richard Wall <richard@largo> | 2011-08-07 22:49:15 +0100 |
---|---|---|
committer | Richard Wall <richard@largo> | 2011-08-07 22:49:15 +0100 |
commit | 478965f7208a328ee81c76cc2482e278b263c68f (patch) | |
tree | 5b395bb7b428f7068744ba5e9e3e01aec66efda7 | |
parent | 47410c6ff7f42c8c812beaddeda9c7e386f87c5b (diff) |
remove unnecessary callback
-rw-r--r-- | jarmon/jarmon.js | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index e24e165..677a817 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -495,16 +495,7 @@ jarmon.RrdQueryRemote.prototype._callRemote = function(methodName, args) { // another download if one is already in progress. var self = this; if(!this._download) { - this._download = this.downloader(this.url) - .pipe( - function(binary) { - // Upon successful download convert the resulting binary - // into an RRD file and pass it on to the next callback - // in the chain. - var rrd = new RRDFile(binary); - self.lastUpdate = rrd.getLastUpdate(); - return rrd; - }); + this._download = this.downloader(this.url); } // Set up a deferred which will call getData on the local RrdQuery object @@ -518,7 +509,12 @@ jarmon.RrdQueryRemote.prototype._callRemote = function(methodName, args) { if(res instanceof Error) { ret.reject(res); } else { - var rq = new jarmon.RrdQuery(res, self.unit); + // Upon successful download convert the resulting binary + // into an RRD file + var rrd = new RRDFile(res); + self.lastUpdate = rrd.getLastUpdate(); + + var rq = new jarmon.RrdQuery(rrd, self.unit); try { ret.resolve(rq[methodName].apply(rq, args)); } catch(e) { |