(customMessage?: string)
| 89 | } |
| 90 | |
| 91 | public startPing(customMessage?: string) { |
| 92 | const prompt = customMessage ?? "The daemon connection was lost. Reload the extension to restart the daemon."; |
| 93 | this.pingIntervalId = setInterval(async () => { |
| 94 | try { |
| 95 | await withTimeout(this.daemonVersion(), "The daemon connection was lost", 10); |
| 96 | } catch (e) { |
| 97 | clearInterval(this.pingIntervalId); |
| 98 | this.logger.error(e); |
| 99 | this.hasShownTerminatedError = true; |
| 100 | void promptToReloadExtension(this.logger, { prompt, restartReason: ExtensionRestartReason.FlutterDaemonTerminatedPing }); |
| 101 | } |
| 102 | }, 60 * 1000).unref(); |
| 103 | } |
| 104 | |
| 105 | // This is for the case where a user has started a flutter daemon process on their local machine where devices are available, and |
| 106 | // has forwarded this port to the remote machine where the Dart extension is running. Netcat is used to access the local devices, |
no test coverage detected