mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-02-10 10:19:25 +00:00
refactor(server): job handlers (#2572)
* refactor(server): job handlers * chore: remove comment * chore: add comments for
This commit is contained in:
@@ -122,14 +122,5 @@ describe(PersonService.name, () => {
|
||||
data: { files: ['/path/to/thumbnail'] },
|
||||
});
|
||||
});
|
||||
|
||||
it('should log an error', async () => {
|
||||
personMock.getAllWithoutFaces.mockResolvedValue([personStub.noName]);
|
||||
personMock.delete.mockRejectedValue(new Error('database unavailable'));
|
||||
|
||||
await sut.handlePersonCleanup();
|
||||
|
||||
expect(jobMock.queue).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ export class PersonService {
|
||||
return mapPerson(person);
|
||||
}
|
||||
|
||||
async handlePersonCleanup(): Promise<void> {
|
||||
async handlePersonCleanup() {
|
||||
const people = await this.repository.getAllWithoutFaces();
|
||||
for (const person of people) {
|
||||
this.logger.debug(`Person ${person.name || person.id} no longer has any faces, deleting.`);
|
||||
@@ -78,5 +78,7 @@ export class PersonService {
|
||||
this.logger.error(`Unable to delete person: ${error}`, error?.stack);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user