mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix(server): sync issue when delete remotes assets (#9479)
This commit is contained in:
parent
f01cf63c70
commit
f28b4e7c99
1 changed files with 5 additions and 3 deletions
|
@ -10,8 +10,8 @@ import { In, LessThan, MoreThan, Repository } from 'typeorm';
|
|||
export class AuditRepository implements IAuditRepository {
|
||||
constructor(@InjectRepository(AuditEntity) private repository: Repository<AuditEntity>) {}
|
||||
|
||||
getAfter(since: Date, options: AuditSearch): Promise<string[]> {
|
||||
return this.repository
|
||||
async getAfter(since: Date, options: AuditSearch): Promise<string[]> {
|
||||
const records = await this.repository
|
||||
.createQueryBuilder('audit')
|
||||
.where({
|
||||
createdAt: MoreThan(since),
|
||||
|
@ -22,7 +22,9 @@ export class AuditRepository implements IAuditRepository {
|
|||
.distinctOn(['audit.entityId', 'audit.entityType'])
|
||||
.orderBy('audit.entityId, audit.entityType, audit.createdAt', 'DESC')
|
||||
.select('audit.entityId')
|
||||
.getRawMany();
|
||||
.getMany();
|
||||
|
||||
return records.map((r) => r.entityId);
|
||||
}
|
||||
|
||||
async removeBefore(before: Date): Promise<void> {
|
||||
|
|
Loading…
Reference in a new issue