space out system queue tasks to not crush the instance all at once

This commit is contained in:
Hazelnoot 2025-06-26 10:55:30 -04:00
parent c5bbd667a7
commit edcaef0727
3 changed files with 11 additions and 11 deletions

View file

@ -83,7 +83,7 @@ export class AggregateRetentionProcessorService {
const data = deepClone(record.data);
data[dateKey] = retention;
this.retentionAggregationsRepository.update(record.id, {
await this.retentionAggregationsRepository.update(record.id, {
updatedAt: now,
data,
});

View file

@ -45,13 +45,13 @@ export class CleanProcessorService {
public async process(): Promise<void> {
this.logger.info('Cleaning...');
this.userIpsRepository.delete({
await this.userIpsRepository.delete({
createdAt: LessThan(new Date(this.timeService.now - (1000 * 60 * 60 * 24 * 90))),
});
// 使われてないアンテナを停止
if (this.config.deactivateAntennaThreshold > 0) {
this.antennasRepository.update({
await this.antennasRepository.update({
lastUsedAt: LessThan(new Date(this.timeService.now - this.config.deactivateAntennaThreshold)),
}, {
isActive: false,
@ -69,7 +69,7 @@ export class CleanProcessorService {
});
}
this.reversiService.cleanOutdatedGames();
await this.reversiService.cleanOutdatedGames();
this.logger.info('Cleaned.');
}