Skip to content

Commit 1fb0537

Browse files
committed
Clean up temp file if user cancels test
1 parent e84a3fa commit 1fb0537

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/controllers/test/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ export default class TestController {
6666
if (socket) {
6767
socket.on('close', () => {
6868
testProcess.kill();
69+
70+
fileSystem.deleteFile(tempFilePath)
71+
.catch(function (error) {
72+
logger.error(`Failed to delete temporary test file ${tempFilePath} with error:`, error);
73+
});
6974
});
7075
}
7176

0 commit comments

Comments
 (0)