More frequent message cleanup
This commit is contained in:
parent
3448f7da92
commit
31c6a2fc0d
2 changed files with 6 additions and 1 deletions
|
@ -14,6 +14,7 @@ export type ConfigKeyType =
|
||||||
| 'desktop.groupCalling'
|
| 'desktop.groupCalling'
|
||||||
| 'desktop.gv2'
|
| 'desktop.gv2'
|
||||||
| 'desktop.internalUser'
|
| 'desktop.internalUser'
|
||||||
|
| 'desktop.messageCleanup'
|
||||||
| 'desktop.mandatoryProfileSharing'
|
| 'desktop.mandatoryProfileSharing'
|
||||||
| 'desktop.mediaQuality.levels'
|
| 'desktop.mediaQuality.levels'
|
||||||
| 'desktop.messageRequests'
|
| 'desktop.messageRequests'
|
||||||
|
|
|
@ -6,6 +6,7 @@ import * as durations from './durations';
|
||||||
import { map, filter } from './iterables';
|
import { map, filter } from './iterables';
|
||||||
import { isNotNil } from './isNotNil';
|
import { isNotNil } from './isNotNil';
|
||||||
import type { MessageAttributesType } from '../model-types.d';
|
import type { MessageAttributesType } from '../model-types.d';
|
||||||
|
import { isEnabled } from '../RemoteConfig';
|
||||||
|
|
||||||
const FIVE_MINUTES = 5 * durations.MINUTE;
|
const FIVE_MINUTES = 5 * durations.MINUTE;
|
||||||
|
|
||||||
|
@ -125,6 +126,9 @@ export class MessageController {
|
||||||
}
|
}
|
||||||
|
|
||||||
startCleanupInterval(): NodeJS.Timeout | number {
|
startCleanupInterval(): NodeJS.Timeout | number {
|
||||||
return setInterval(this.cleanup.bind(this), durations.HOUR);
|
return setInterval(
|
||||||
|
this.cleanup.bind(this),
|
||||||
|
isEnabled('desktop.messageCleanup') ? FIVE_MINUTES : durations.HOUR
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue