Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions api/ecosystem.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"apps": [
{
"name": "unraid-api",
"script": "npm",
"args": "start",
"script": "./dist/main.js",
"cwd": "/usr/local/unraid-api",
"log": "/var/log/unraid-api/unraid-api.log",
"exec_mode": "fork",
"wait_ready": true,
"listen_timeout": 30000,
"max_restarts": 10,
"min_uptime": 10000,
"ignore_watch": [
"node_modules",
"src",
Expand All @@ -17,4 +18,4 @@
]
}
]
}
}
7 changes: 1 addition & 6 deletions api/src/unraid-api/auth/api-key.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ describe('ApiKeyService', () => {
vi.mocked(ensureDir).mockResolvedValue();

apiKeyService = new ApiKeyService();
await apiKeyService.initialize();

vi.spyOn(apiKeyService as any, 'generateApiKey').mockReturnValue('test-api-key');
vi.mock('uuid', () => ({
Expand All @@ -113,12 +112,8 @@ describe('ApiKeyService', () => {

describe('initialization', () => {
it('should ensure directory exists', async () => {
vi.mocked(ensureDir).mockResolvedValue();
const service = new ApiKeyService();

await service.initialize();

expect(ensureDir).toHaveBeenCalledWith(mockBasePath);
expect(ensureDirSync).toHaveBeenCalledWith(mockBasePath);
});

it('should return correct paths', async () => {
Expand Down
2 changes: 2 additions & 0 deletions api/src/unraid-api/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export async function bootstrapNestServer(): Promise<NestFastifyApplication> {
// See https://pm2.keymetrics.io/docs/usage/signals-clean-restart/
if (process.send) {
process.send('ready');
} else {
console.log('Warning: process.send is unavailable. This will affect IPC communication with PM2.');
}
apiLogger.info('Nest Server is now listening');

Expand Down
Loading