space out system queue tasks to not crush the instance all at once
This commit is contained in:
parent
c5bbd667a7
commit
edcaef0727
3 changed files with 11 additions and 11 deletions
|
|
@ -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,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue