From 478965f7208a328ee81c76cc2482e278b263c68f Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 7 Aug 2011 22:49:15 +0100 Subject: remove unnecessary callback --- jarmon/jarmon.js | 18 +++++++----------- 1 file 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) { -- cgit v1.2.3