Skip to content

Commit

Permalink
SDA-4361 - Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
KiranNiranjan authored and Kiran Niranjan committed Oct 10, 2023
1 parent e2ef65d commit bc427ff
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/app/bi/analytics-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ class Analytics {
{ encoding: 'utf8' },
);
logger.info(
`stats: updated stats values with the data ${JSON.stringify(
`analytics-handler: updated analytic values with the data ${JSON.stringify(
this.analyticsEndEventQueue,
)}`,
);
} catch (error) {
logger.error(
`stats: failed to update stats with ${JSON.stringify(
`analytics-handler: failed to update analytic with ${JSON.stringify(
this.analyticsEndEventQueue,
)}`,
error,
Expand All @@ -217,7 +217,7 @@ class Analytics {
/**
* Sends all the locally stored stats
*/
public sendLocalAnalytics = async () => {
public sendLocalAnalytics = () => {
if (fs.existsSync(this.analyticEventsDataFilePath)) {
const localStats = fs.readFileSync(
this.analyticEventsDataFilePath,
Expand All @@ -229,15 +229,20 @@ class Analytics {
let parsedStats: ISessionData[];
try {
parsedStats = JSON.parse(localStats);
logger.info(`stats: parsed stats JSON file with data`, parsedStats);
logger.info(
`analytics-handler: parsed stats JSON file with data`,
parsedStats,
);
if (parsedStats && parsedStats.length) {
parsedStats.forEach((event) => {
this.sendAnalyticsOrAddToQueue(event);
});
fs.unlinkSync(this.analyticEventsDataFilePath);
}
} catch (e: any) {
logger.error(`stats: parsing stats JSON file failed due to error ${e}`);
logger.error(
`analytics-handler: parsing stats JSON file failed due to error ${e}`,
);
}
}
if (this.analyticsEndEventQueue.length > 0) {
Expand Down

0 comments on commit bc427ff

Please sign in to comment.