mirror of
https://github.com/directus/directus.git
synced 2026-01-24 10:47:56 -05:00
healthcheck crashes with local file storage (#16944)
* Update api/src/services/server.ts * remove try catch in write * Update api/src/services/server.ts Co-authored-by: Freekrai <freekrai@users.noreply.github.com> Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
This commit is contained in:
@@ -308,8 +308,11 @@ export class ServerService {
|
||||
|
||||
try {
|
||||
await disk.write(`health-${checkID}`, Readable.from(['check']));
|
||||
await disk.read(`health-${checkID}`);
|
||||
await disk.delete(`health-${checkID}`);
|
||||
const fileStream = await disk.read(`health-${checkID}`);
|
||||
fileStream.on('data', async () => {
|
||||
fileStream.destroy();
|
||||
await disk.delete(`health-${checkID}`);
|
||||
});
|
||||
} catch (err: any) {
|
||||
checks[`storage:${location}:responseTime`][0].status = 'error';
|
||||
checks[`storage:${location}:responseTime`][0].output = err;
|
||||
|
||||
Reference in New Issue
Block a user