mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 03:13:10 +02:00
enhance(server): delete outdated notes of antenna regularly to improve db performance
This commit is contained in:
parent
ad4d8b07d3
commit
a9a245b461
2 changed files with 9 additions and 1 deletions
|
@ -27,6 +27,7 @@ You should also include the user name that made the change.
|
|||
- Server: improve note scoring for featured notes @CyberRex0
|
||||
- Server: delete outdated notifications regularly to improve db performance @syuilo
|
||||
- Server: delete outdated hard-mutes regularly to improve db performance @syuilo
|
||||
- Server: delete outdated notes of antenna regularly to improve db performance @syuilo
|
||||
- Client: use tabler-icons instead of fontawesome to better design @syuilo
|
||||
- Client: Add new gabber kick sounds (thanks for noizenecio)
|
||||
- Client: Compress non-animated PNG files @saschanaz
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { In, LessThan, MoreThan } from 'typeorm';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type { MutedNotesRepository, NotificationsRepository, UserIpsRepository } from '@/models/index.js';
|
||||
import type { AntennaNotesRepository, MutedNotesRepository, NotificationsRepository, UserIpsRepository } from '@/models/index.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import type Logger from '@/logger.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
|
@ -26,6 +26,9 @@ export class CleanProcessorService {
|
|||
@Inject(DI.mutedNotesRepository)
|
||||
private mutedNotesRepository: MutedNotesRepository,
|
||||
|
||||
@Inject(DI.antennaNotesRepository)
|
||||
private antennaNotesRepository: AntennaNotesRepository,
|
||||
|
||||
private queueLoggerService: QueueLoggerService,
|
||||
private idService: IdService,
|
||||
) {
|
||||
|
@ -49,6 +52,10 @@ export class CleanProcessorService {
|
|||
reason: 'word',
|
||||
});
|
||||
|
||||
this.antennaNotesRepository.delete({
|
||||
id: LessThan(this.idService.genId(new Date(Date.now() - (1000 * 60 * 60 * 24 * 90)))),
|
||||
});
|
||||
|
||||
this.logger.succ('Cleaned.');
|
||||
done();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue