Skip to content

Commit

Permalink
optimized error handling
Browse files Browse the repository at this point in the history
afuerhoff committed Dec 20, 2024
1 parent 9cc7172 commit 6bc4785
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 2 additions & 3 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/main.js.map

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -823,8 +823,7 @@ class Solarviewdatareader extends utils.Adapter {

private async processQueue(): Promise<void> {
if (this.isProcessingQueue) {
this.chkCnt += 1;
this.log.warn(`processQueue: command queue not empty! Waiting for server ... ${this.chkCnt}`);
this.log.warn(`processQueue: command queue not empty! Waiting for solarview server ...`);
return;
}
this.isProcessingQueue = true;
@@ -837,16 +836,14 @@ class Solarviewdatareader extends utils.Adapter {
this.isProcessingCmd = true;
await this.executeCommand(cmd);
if (this.isError === true) {
this.log.warn('Server connection is now working again!');
this.log.info('Server connection is now working again!');
this.isError = false;
}
} catch {
this.isError = true;
//this.errorHandler(`Error executing command ${cmd}`, error);
this.commandQueue.length = 0; // Queue löschen
this.isProcessingQueue = false;
this.isProcessingCmd = false;
//throw error;
}
}
}

0 comments on commit 6bc4785

Please sign in to comment.