Skip to content

Commit 9fde549

Browse files
authored
Merge branch 'master' into content-builder-improvement-and-fixes
2 parents 2b44612 + 56d4bc7 commit 9fde549

File tree

2 files changed

+33
-28
lines changed

2 files changed

+33
-28
lines changed

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
## Version 25.03.XX
1+
## Version 25.03.24
2+
Fixes:
3+
- [jobs] Fix condition for scheduling alert job
4+
25
Enterprise Fixes:
36
- [compliance-hub] Fixed query patterns
4-
- [data-manager] Fixed segment data deletion
57
- [data-manager] Fixed bug preventing transformation of events ending in a dot
8+
- [data-manager] Fixed segment data deletion
9+
- [license] Stop sending metric after license expired
610
- [users] Fix add/remove user to profile group
711
- [users] Remove link to profile group page after removing user from group
812

913
Dependencies
10-
- Bump lint-staged from 16.2.3 to 16.2.4
1114
- Bump @faker-js/faker from 10.0.0 to 10.1.0 in /ui-tests
12-
- Bump puppeteer from 24.23.0 to 24.24.1
1315
- Bump countly-sdk-nodejs from 24.10.2 to 24.10.3
16+
- Bump lint-staged from 16.2.3 to 16.2.4
17+
- Bump puppeteer from 24.23.0 to 24.24.1
1418

1519
## Version 25.03.23
1620
Fixes:

api/parts/jobs/job.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -254,32 +254,33 @@ class Job extends EventEmitter {
254254

255255
this._json.next = next.getTime();
256256
}
257-
if (this.name !== "alerts:monitor") {
258-
//check if any job already scheduled or running
259-
let query = {
260-
status: {"$in": [STATUS.SCHEDULED, STATUS.RUNNING]},
261-
name: this.name,
262-
};
263-
if (this._id) {
264-
query._id = {$ne: this._id};
265-
}
266-
var self = this;
267-
return new Promise((resolve, reject) => {
268-
Job.findMany(this.db(), query).then(existing => {
269-
if (existing && existing.length) {
270-
log.d('Job already scheduled or running: %j', existing);
271-
this._json.status = STATUS.CANCELLED; //set this as cancelled now as we have other scheduled
272-
}
273-
else {
274-
self._save().then(resolve, reject);
275-
}
276257

277-
});
278-
});
258+
//check if any job already scheduled or running
259+
let query = {
260+
status: {"$in": [STATUS.SCHEDULED, STATUS.RUNNING]},
261+
name: this.name,
262+
};
263+
264+
if (this.name === 'alerts:monitor' && this.data && Object.keys(this.data).length) {
265+
query.data = this.data;
279266
}
280-
else {
281-
return this._save();
267+
268+
if (this._id) {
269+
query._id = {$ne: this._id};
282270
}
271+
272+
var self = this;
273+
return new Promise((resolve, reject) => {
274+
Job.findMany(this.db(), query).then(existing => {
275+
if (existing && existing.length) {
276+
log.d('Job already scheduled or running: %j', existing);
277+
this._json.status = STATUS.CANCELLED; //set this as cancelled now as we have other scheduled
278+
}
279+
else {
280+
self._save().then(resolve, reject);
281+
}
282+
});
283+
});
283284
}
284285

285286
/**
@@ -1142,4 +1143,4 @@ module.exports = {
11421143
STATUS: STATUS,
11431144
STATUS_MAP: STATUS_MAP,
11441145
debounce: debounce
1145-
};
1146+
};

0 commit comments

Comments
 (0)