Skip to content

Commit

Permalink
Done't delete old volime files when sutting down recorder.
Browse files Browse the repository at this point in the history
Its useful to keep these around just so we don't get errors
when we start up a client before recording has got going
  • Loading branch information
akc42 committed Mar 8, 2020
1 parent d22d0d9 commit 34a0d1c
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions server/recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,7 @@ const jwt = require('jwt-simple');
debugdata('received ffmpeg chunk', chunk.toString());
});
this.__recordingPromise = Promise.resolve();
this._volumePromise = new Promise(resolve => this._volume.once('exit', async () => {
debug('ffmpeg exited - delete videos');
const directory = path.resolve(__dirname,'../', dir)
const files = await fs.readdir(directory);
for (let file of files) {
await fs.unlink(path.resolve(directory,file));
}

delete this._ffmpeg
resolve();
}));
this._volumePromise = new Promise(resolve => this._volume.once('exit', resolve));
this._name = name;
}
get name() {
Expand Down

0 comments on commit 34a0d1c

Please sign in to comment.