"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "api/jobs/topEvents.js" between
countly-server-20.04.1.4.tar.gz and countly-server-20.04.1.5.tar.gz

About: countly-server is a mobile & web analytics, push notifications and crash reporting platform. This is the server part that collects and analyzes data while individual client SDKs (mobile, web or desktop) send the data. Community Edition (commercial Enterprise Edition also available).

topEvents.js  (countly-server-20.04.1.4):topEvents.js  (countly-server-20.04.1.5)
skipping to change at line 147 skipping to change at line 147
*/ */
async getAppEvents(app) { async getAppEvents(app) {
const getEvents = await new Promise((res, rej) => common.db.collection(" events").findOne({_id: app._id}, (errorEvents, result) => errorEvents ? rej(erro rEvents) : res(result))); const getEvents = await new Promise((res, rej) => common.db.collection(" events").findOne({_id: app._id}, (errorEvents, result) => errorEvents ? rej(erro rEvents) : res(result)));
if (getEvents && 'list' in getEvents) { if (getEvents && 'list' in getEvents) {
const eventMap = this.eventsFilter(getEvents.list); const eventMap = this.eventsFilter(getEvents.list);
await new Promise((res, rej) => common.db.collection(TopEventsJob.CO LLECTION_NAME).remove({app_id: app._id}, (error, result) => error ? rej(error) : res(result))); await new Promise((res, rej) => common.db.collection(TopEventsJob.CO LLECTION_NAME).remove({app_id: app._id}, (error, result) => error ? rej(error) : res(result)));
if (eventMap && eventMap instanceof Array && eventMap.length >= TopE ventsJob.TOTAL_EVENT_COUNT) { if (eventMap && eventMap instanceof Array && eventMap.length >= TopE ventsJob.TOTAL_EVENT_COUNT) {
for (const period of TopEventsJob.PERIODS) { for (const period of TopEventsJob.PERIODS) {
const data = {}; const data = {};
const ob = { app_id: app._id, appTimezone: app.timezone, qst ring: { period: period } }; const ob = { app_id: app._id, appTimezone: app.timezone, qst ring: { period: period } };
if (period === "hour") {
ob.time = common.initTimeObj(app.timezone, new Date().ge
tTime());
ob.qstring.action = "refresh";
}
for (const event of eventMap) { for (const event of eventMap) {
const collectionNameEvents = this.eventsCollentions({eve nt, id: app._id}); const collectionNameEvents = this.eventsCollentions({eve nt, id: app._id});
await this.getEventsCount({collectionNameEvents, ob, dat a, event}); await this.getEventsCount({collectionNameEvents, ob, dat a, event});
} }
await this.saveAppEvents({app, data, period}); await this.saveAppEvents({app, data, period});
} }
} }
} }
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)