mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server): custom library scanning interval (#4390)
* add automatic library scan config options * add validation * open api * use CronJob instead of cron-validator * fix tests * catch potential error of the library scan initialization * better description for input field * move library scan job initialization to server app service * fix tests * add comments to all parameters of cronjob contructor * make scan a child of a more general library object * open api * chore: cleanup * move cronjob handling to job repoistory * web: select for common cron expressions * fix open api * fix tests * put scanning settings in nested accordion * fix system config validation * refactor, tests --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
@@ -3,6 +3,9 @@ import { IJobRepository } from '@app/domain';
|
||||
export const newJobRepositoryMock = (): jest.Mocked<IJobRepository> => {
|
||||
return {
|
||||
addHandler: jest.fn(),
|
||||
addCronJob: jest.fn(),
|
||||
deleteCronJob: jest.fn(),
|
||||
updateCronJob: jest.fn(),
|
||||
setConcurrency: jest.fn(),
|
||||
empty: jest.fn(),
|
||||
pause: jest.fn(),
|
||||
|
||||
@@ -49,6 +49,10 @@ export const testApp = {
|
||||
.overrideProvider(IJobRepository)
|
||||
.useValue({
|
||||
addHandler: (_queueName: QueueName, _concurrency: number, handler: JobItemHandler) => (_handler = handler),
|
||||
addCronJob: jest.fn(),
|
||||
updateCronJob: jest.fn(),
|
||||
deleteCronJob: jest.fn(),
|
||||
validateCronExpression: jest.fn(),
|
||||
queue: (item: JobItem) => jobs && _handler(item),
|
||||
resume: jest.fn(),
|
||||
empty: jest.fn(),
|
||||
|
||||
Reference in New Issue
Block a user