Skip to content

Commit aad4ab9

Browse files
authored
Merge pull request #753 from waiterZen/SERVER-1183
[compare] fix campare query bug
2 parents da9ca19 + 2f79f15 commit aad4ab9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

plugins/compare/api/api.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,14 @@ var exported = {},
184184
};
185185

186186
var data = {id: app._id, name: app.name, sessions: sessionData.total_sessions, users: sessionData.total_users, newusers: sessionData.new_users, duration: sessionData.total_time, avgduration: sessionData.avg_time, charts: charts};
187-
188187
callback(null, data);
189188
});
190189
});
191190
},
192-
function(res) {
191+
function(err2, res) {
192+
if (err2) {
193+
return common.returnMessage(params, 503, 'Fetch apps data failed');
194+
}
193195
common.returnOutput(params, res);
194196
});
195197
});

plugins/compare/frontend/public/javascripts/countly.models.js

+3
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@
269269
}
270270

271271
_appData.all.avgduration.total = (_appData.all.sessions.total === 0) ? 0 : _appData.all.duration.total / _appData.all.sessions.total;
272+
},
273+
error: function() {
274+
window.CountlyHelpers.notify({type: 'error', message: jQuery.i18n.map['management-applications.plugins.error.server']});
272275
}
273276
});
274277
};

0 commit comments

Comments
 (0)