fix: do not silently fail when cleaning up previous stream direcvtory

This commit is contained in:
Christian Benincasa
2026-04-13 16:19:49 -04:00
parent ce34bef8c5
commit 22fd0e4bc3

View File

@@ -135,14 +135,11 @@ export abstract class BaseHlsSession<
'Cleaning up existing working directory: %s',
this._workingDirectory,
);
await fs.rmdir(this._workingDirectory, { recursive: true });
await fs.rm(this._workingDirectory, { recursive: true, force: true });
await fs.mkdir(this._workingDirectory);
} catch (err) {
return this.logger.error(
err,
'Failed to cleanup stream: %s',
this.channel.uuid,
);
this.logger.error(err, 'Failed to cleanup stream: %s', this.channel.uuid);
throw err;
}
}