Skip to content

Commit

Permalink
Ok to race with the agent when deleting addr file
Browse files Browse the repository at this point in the history
Filesystem on Windows can be tricky.
Autorestart the agent in loop opens possibility for not found exceptions
That shouldn't be a problem.
  • Loading branch information
CarlosNihelton committed Oct 30, 2023
1 parent e26a0b5 commit 72eb26a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gui/packages/ubuntupro/lib/pages/startup/agent_monitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ class AgentStartupMonitor {
/// Thus, we delete the existing `addr` file and retry launching the agent.
Future<void> reset() async {
if (_addrFilePath != null) {
await File(_addrFilePath!).delete();
try {
await File(_addrFilePath!).delete();
} on PathNotFoundException {
// TODO: Log
// ignore: avoid_print
print(
'Port file expected but not found. Likely a race with the agent at this point, not an issue.',
);
}
}
}
}
Expand Down

0 comments on commit 72eb26a

Please sign in to comment.