Skip to content

Commit

Permalink
Merge pull request #17 from derekr/fix-global-scope
Browse files Browse the repository at this point in the history
Don't leak thothFieldsMappings in to global scope
  • Loading branch information
ingiulio committed Dec 1, 2014
2 parents 2bce085 + 698e405 commit cb9644f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
5 changes: 2 additions & 3 deletions dispatchers/list_dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require('./../fields_mapping')();
require('./../environment')();
var thothFieldsMappings = require('./../fields_mapping')();

var http = require('http');
var httpRequestHelper = require('./../helpers/http_request');
Expand Down Expand Up @@ -28,4 +27,4 @@ module.exports = {
console.log(e);
});
}
};
};
5 changes: 2 additions & 3 deletions dispatchers/pools_dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require('./../fields_mapping')();
require('./../environment')();
var thothFieldsMappings = require('./../fields_mapping')();

var http = require('http');
var httpRequestHelper = require('./../helpers/http_request');
Expand Down Expand Up @@ -42,4 +41,4 @@ module.exports = {
console.log('error while trying to dispatch pool request', e);
});
}
};
};
5 changes: 2 additions & 3 deletions dispatchers/realtime_dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require('./../fields_mapping')();
require('./../environment')();
var thothFieldsMappings = require('./../fields_mapping')();

var http = require('http');
var querystring = require('querystring');
Expand Down Expand Up @@ -78,4 +77,4 @@ module.exports = {
console.log('Error while trying to get zero hits real time data: ', e);
});
}
};
};
5 changes: 2 additions & 3 deletions dispatchers/servers_dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require('./../fields_mapping')();
require('./../environment')();
var thothFieldsMappings = require('./../fields_mapping')();

var http = require('http');
var httpRequestHelper = require('./../helpers/http_request');
Expand Down Expand Up @@ -72,4 +71,4 @@ module.exports = {
});
}
}
};
};
6 changes: 3 additions & 3 deletions fields_mapping.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function () {
thothFieldsMappings = {
return {
avg : {
qtime: 'avg_qtime_d',
nqueries: 'tot-count_i',
Expand All @@ -20,6 +20,6 @@ module.exports = function () {
},
slowqueries: 'params_s,qtime_i',
exception: 'params_s,stackTrace_s'

};
};
};

0 comments on commit cb9644f

Please sign in to comment.