forked from immich-app/immich
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: microservices be gone (immich-app#9551)
* feat: microservices be gone and api is a worker now too * chore: remove very old startup scripts, surely nobody is using these anymore, right? right?....
- Loading branch information
1 parent
ff52300
commit 85aca2b
Showing
12 changed files
with
204 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { getWorkers } from 'src/utils/workers'; | ||
|
||
describe('getWorkers', () => { | ||
beforeEach(() => { | ||
process.env.IMMICH_WORKERS_INCLUDE = ''; | ||
process.env.IMMICH_WORKERS_EXCLUDE = ''; | ||
}); | ||
|
||
it('should return default workers', () => { | ||
expect(getWorkers()).toEqual(['api', 'microservices']); | ||
}); | ||
|
||
it('should return included workers', () => { | ||
process.env.IMMICH_WORKERS_INCLUDE = 'api'; | ||
expect(getWorkers()).toEqual(['api']); | ||
}); | ||
|
||
it('should excluded workers from defaults', () => { | ||
process.env.IMMICH_WORKERS_EXCLUDE = 'api'; | ||
expect(getWorkers()).toEqual(['microservices']); | ||
}); | ||
|
||
it('should exclude workers from include list', () => { | ||
process.env.IMMICH_WORKERS_INCLUDE = 'api,microservices,randomservice'; | ||
process.env.IMMICH_WORKERS_EXCLUDE = 'randomservice,microservices'; | ||
expect(getWorkers()).toEqual(['api']); | ||
}); | ||
|
||
it('should remove whitespace from included workers before parsing', () => { | ||
process.env.IMMICH_WORKERS_INCLUDE = 'api, microservices'; | ||
expect(getWorkers()).toEqual(['api', 'microservices']); | ||
}); | ||
|
||
it('should remove whitespace from excluded workers before parsing', () => { | ||
process.env.IMMICH_WORKERS_EXCLUDE = 'api, microservices'; | ||
expect(getWorkers()).toEqual([]); | ||
}); | ||
|
||
it('should remove whitespace from included and excluded workers before parsing', () => { | ||
process.env.IMMICH_WORKERS_INCLUDE = 'api, microservices, randomservice,randomservice2'; | ||
process.env.IMMICH_WORKERS_EXCLUDE = 'randomservice,microservices, randomservice2'; | ||
expect(getWorkers()).toEqual(['api']); | ||
}); | ||
|
||
it('should throw error for invalid workers', () => { | ||
process.env.IMMICH_WORKERS_INCLUDE = 'api,microservices,randomservice'; | ||
expect(getWorkers).toThrowError('Invalid worker(s) found: api,microservices,randomservice'); | ||
}); | ||
}); |
Oops, something went wrong.