Browse Source

Optimization

pull/9824/head
Andrii Shvaika 3 years ago
parent
commit
930ec47649
  1. 12
      dao/src/main/java/org/thingsboard/server/dao/sql/TbSqlBlockingQueue.java

12
dao/src/main/java/org/thingsboard/server/dao/sql/TbSqlBlockingQueue.java

@ -84,17 +84,17 @@ public class TbSqlBlockingQueue<E> implements TbSqlQueue<E> {
} }
} }
} catch (Throwable t) { } catch (Throwable t) {
try {
stats.incrementFailed(entities.size());
entities.forEach(entityFutureWrapper -> entityFutureWrapper.getFuture().setException(t));
} catch (Throwable th) {
log.error("[{}] Failed to set future exception", logName, th);
}
if (t instanceof InterruptedException) { if (t instanceof InterruptedException) {
log.info("[{}] Queue polling was interrupted", logName); log.info("[{}] Queue polling was interrupted", logName);
break; break;
} else { } else {
log.error("[{}] Failed to save {} entities", logName, entities.size(), t); log.error("[{}] Failed to save {} entities", logName, entities.size(), t);
try {
stats.incrementFailed(entities.size());
entities.forEach(entityFutureWrapper -> entityFutureWrapper.getFuture().setException(t));
} catch (Throwable th) {
log.error("[{}] Failed to set future exception", logName, th);
}
} }
} finally { } finally {
entities.clear(); entities.clear();

Loading…
Cancel
Save