mirror of
https://github.com/immich-app/immich.git
synced 2025-02-18 01:24:26 -05: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 {
|
export class AuditRepository implements IAuditRepository {
|
||||||
constructor(@InjectRepository(AuditEntity) private repository: Repository<AuditEntity>) {}
|
constructor(@InjectRepository(AuditEntity) private repository: Repository<AuditEntity>) {}
|
||||||
|
|
||||||
getAfter(since: Date, options: AuditSearch): Promise<string[]> {
|
async getAfter(since: Date, options: AuditSearch): Promise<string[]> {
|
||||||
return this.repository
|
const records = await this.repository
|
||||||
.createQueryBuilder('audit')
|
.createQueryBuilder('audit')
|
||||||
.where({
|
.where({
|
||||||
createdAt: MoreThan(since),
|
createdAt: MoreThan(since),
|
||||||
|
@ -22,7 +22,9 @@ export class AuditRepository implements IAuditRepository {
|
||||||
.distinctOn(['audit.entityId', 'audit.entityType'])
|
.distinctOn(['audit.entityId', 'audit.entityType'])
|
||||||
.orderBy('audit.entityId, audit.entityType, audit.createdAt', 'DESC')
|
.orderBy('audit.entityId, audit.entityType, audit.createdAt', 'DESC')
|
||||||
.select('audit.entityId')
|
.select('audit.entityId')
|
||||||
.getRawMany();
|
.getMany();
|
||||||
|
|
||||||
|
return records.map((r) => r.entityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeBefore(before: Date): Promise<void> {
|
async removeBefore(before: Date): Promise<void> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue