Skip to content

Commit 3e5ba13

Browse files
committed
Fix events reporting using hook
1 parent 39a2588 commit 3e5ba13

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/configs/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = function(options) {
2222

2323
// Events reporting
2424
'reporting': {
25-
'timeout': 180 * 1e3
25+
'timeout': 180
2626
},
2727

2828
// Authentication settings

lib/configs/local.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ var wrench = require('wrench');
66

77
var logger = require("../utils/logger")("local");
88

9-
var LOCAL_SETTINGS_DIR = path.join(
9+
var LOCAL_SETTINGS_DIR = process.env.WORKSPACE_CODEBOX_DIR || path.join(
1010
process.env.HOME,
1111
'.codebox'
1212
);
1313

14-
var SETTINGS_FILE = process.env.WORKSPACE_CODEBOX_DIR || path.join(LOCAL_SETTINGS_DIR, 'settings.json')
14+
var SETTINGS_FILE = path.join(LOCAL_SETTINGS_DIR, 'settings.json');
1515

1616
// Base structure for a local workspace
1717
// Store the workspace configuration in a file, ...

lib/events.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var init = function(config) {
3838
var eventQueue = [];
3939

4040
// Send events and empty queue
41-
var sendEvents = _.debounce(function sendEvents() {
41+
var sendEvents = _.debounce(function() {
4242
logger.log("report", _.size(eventQueue), "events");
4343

4444
// Hit hook
@@ -48,7 +48,7 @@ var init = function(config) {
4848
eventQueue = [];
4949
}, timeout);
5050

51-
var queueEvent = function queueEvent(eventData) {
51+
var queueEvent = function(eventData) {
5252
eventQueue.push(eventData);
5353
};
5454

@@ -74,7 +74,7 @@ var init = function(config) {
7474
sendEvents();
7575
});
7676

77-
logger.log("events are ready");
77+
logger.log("events are ready, reporting is debounced to", (timeout/1000).toFixed(0)+"s");
7878
};
7979

8080

0 commit comments

Comments
 (0)