Skip to content

Commit

Permalink
fix incomplete data being stored in the endpointgroupreports table
Browse files Browse the repository at this point in the history
Signed-off-by: Utkarsh Srivastava <[email protected]>

fix typo

Signed-off-by: Utkarsh Srivastava <[email protected]>
  • Loading branch information
tangledbytes committed Oct 16, 2024
1 parent 7ad546f commit 73a0747
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/server/analytic_services/endpoint_stats_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ class EndpointStatsStore {

async get_endpoint_group_reports(params) {
dbg.log1('get_endpoint_group_reports', params);
const query = this._format_endpoint_gorup_report_query(params);
const query = this._format_endpoint_group_report_query(params);
return this._endpoint_group_reports.find(query);
}

async clean_endpoint_group_reports(params) {
dbg.log1('clean_endpoint_group_reports', params);
const query = this._format_endpoint_gorup_report_query(params);
const query = this._format_endpoint_group_report_query(params);
return this._endpoint_group_reports.deleteMany(query);
}

_format_endpoint_gorup_report_query(params) {
_format_endpoint_group_report_query(params) {
const { groups, since, till } = params;
const query = {};
if (groups) _.set(query, ['group_name', '$in'], _.castArray(groups));
Expand All @@ -196,6 +196,7 @@ class EndpointStatsStore {
group_name: report.endpoint_group,
};
const update = {
$set: selector,
$push: {
endpoints: _.pick(report, [
'hostname',
Expand Down

0 comments on commit 73a0747

Please sign in to comment.