mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-10 10:58:33 +00:00
Gracefully handle disconnected frontends.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -10,6 +10,9 @@ import { ToolOutputServiceServer } from '../common/protocol/tool-output-service'
|
||||
@injectable()
|
||||
export class BoardsServiceImpl implements BoardsService {
|
||||
|
||||
@inject(ILogger)
|
||||
protected logger: ILogger;
|
||||
|
||||
@inject(ILogger)
|
||||
@named('discovery')
|
||||
protected discoveryLogger: ILogger;
|
||||
@@ -95,9 +98,13 @@ export class BoardsServiceImpl implements BoardsService {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.logger.info('>>> Disposing boards service...')
|
||||
this.queue.pause();
|
||||
this.queue.clear();
|
||||
if (this.discoveryTimer !== undefined) {
|
||||
clearInterval(this.discoveryTimer);
|
||||
}
|
||||
this.logger.info('<<< Disposed boards service.')
|
||||
}
|
||||
|
||||
async getAttachedBoards(): Promise<{ boards: Board[] }> {
|
||||
|
||||
Reference in New Issue
Block a user