reduce updateUserQueue interval
This commit is contained in:
parent
81fd01d5fa
commit
e7ea4a3ba2
1 changed files with 2 additions and 1 deletions
|
|
@ -49,6 +49,7 @@ export class CollapsedQueueService implements OnApplicationShutdown {
|
||||||
this.logger = loggerService.getLogger('collapsed-queue');
|
this.logger = loggerService.getLogger('collapsed-queue');
|
||||||
|
|
||||||
const fiveMinuteInterval = this.envService.env.NODE_ENV !== 'test' ? 60 * 1000 * 5 : 0;
|
const fiveMinuteInterval = this.envService.env.NODE_ENV !== 'test' ? 60 * 1000 * 5 : 0;
|
||||||
|
const oneMinuteInterval = this.envService.env.NODE_ENV !== 'test' ? 60 * 1000 : 0;
|
||||||
|
|
||||||
this.updateInstanceQueue = new CollapsedQueue(
|
this.updateInstanceQueue = new CollapsedQueue(
|
||||||
'updateInstance',
|
'updateInstance',
|
||||||
|
|
@ -72,7 +73,7 @@ export class CollapsedQueueService implements OnApplicationShutdown {
|
||||||
|
|
||||||
this.updateUserQueue = new CollapsedQueue(
|
this.updateUserQueue = new CollapsedQueue(
|
||||||
'updateUser',
|
'updateUser',
|
||||||
fiveMinuteInterval,
|
oneMinuteInterval,
|
||||||
(oldJob, newJob) => ({
|
(oldJob, newJob) => ({
|
||||||
updatedAt: maxDate(oldJob.updatedAt, newJob.updatedAt),
|
updatedAt: maxDate(oldJob.updatedAt, newJob.updatedAt),
|
||||||
additionalNotes: (oldJob.additionalNotes ?? 0) + (newJob.additionalNotes ?? 0),
|
additionalNotes: (oldJob.additionalNotes ?? 0) + (newJob.additionalNotes ?? 0),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue