SEBSERV-182 updateErrors

This commit is contained in:
anhefti 2021-07-07 08:46:41 +02:00
parent 5724a750b7
commit 03c05c7372
2 changed files with 50 additions and 35 deletions

View file

@ -174,7 +174,7 @@ public class MonitoringRunningExam implements TemplateComposer {
this.serverPushService.runServerPush( this.serverPushService.runServerPush(
new ServerPushContext( new ServerPushContext(
content, content,
Utils.truePredicate(), context -> clientTable.getUpdateErrors() > 5,
createServerPushUpdateErrorHandler(this.pageService, pageContext)), createServerPushUpdateErrorHandler(this.pageService, pageContext)),
this.pollInterval, this.pollInterval,
context -> clientTable.updateValues(), context -> clientTable.updateValues(),

View file

@ -116,6 +116,8 @@ public final class ClientConnectionTable {
private boolean forceUpdateAll = false; private boolean forceUpdateAll = false;
private boolean updateInProgress = false; private boolean updateInProgress = false;
private int updateErrors = 0;
public ClientConnectionTable( public ClientConnectionTable(
final PageService pageService, final PageService pageService,
final Composite tableRoot, final Composite tableRoot,
@ -188,6 +190,10 @@ public final class ClientConnectionTable {
this.table.layout(); this.table.layout();
} }
public int getUpdateErrors() {
return this.updateErrors;
}
public WidgetFactory getWidgetFactory() { public WidgetFactory getWidgetFactory() {
return this.pageService.getWidgetFactory(); return this.pageService.getWidgetFactory();
} }
@ -320,6 +326,9 @@ public final class ClientConnectionTable {
} }
private void updateValuesAsync() { private void updateValuesAsync() {
try {
if (this.statusFilterChanged || this.forceUpdateAll) { if (this.statusFilterChanged || this.forceUpdateAll) {
this.toDelete.clear(); this.toDelete.clear();
this.toDelete.addAll(this.tableMapping.keySet()); this.toDelete.addAll(this.tableMapping.keySet());
@ -358,6 +367,12 @@ public final class ClientConnectionTable {
this.forceUpdateAll = false; this.forceUpdateAll = false;
this.updateInProgress = false; this.updateInProgress = false;
this.updateErrors = 0;
} catch (final Exception e) {
log.error("Unexpected error while updating client connection table: ", e);
this.updateErrors++;
}
} }
public void updateGUI() { public void updateGUI() {