Ignore an exception when deleting the temporary driver cache directory.

Change-Id: I019adc6211af2db861900aaa80a126a48419be77
Reviewed-on: https://dart-review.googlesource.com/66620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This commit is contained in:
Devon Carew 2018-07-25 14:35:08 +00:00
parent 432e59e589
commit ab0d27b694

View file

@ -458,7 +458,7 @@ class Driver implements ServerStarter {
if (trainDirectory != null) {
Directory tempDriverDir =
Directory.systemTemp.createTempSync('dartServer');
Directory.systemTemp.createTempSync('analysis_server_');
analysisServerOptions.cacheFolder = tempDriverDir.path;
DevAnalysisServer devServer = new DevAnalysisServer(socketServer);
@ -475,11 +475,17 @@ class Driver implements ServerStarter {
print('Analyzing with a populated driver cache:');
exitCode = await devServer.processDirectories([trainDirectory]);
tempDriverDir.deleteSync(recursive: true);
if (serve_http) {
httpServer.close();
}
await instrumentationService.shutdown();
try {
tempDriverDir.deleteSync(recursive: true);
} catch (_) {
// ignore any exception
}
exit(exitCode);
}();
} else {