Browse Source

Merge pull request #9144 from smatvienko-tb/hotfix/script_blocked_log_tenant_id

AbstractScriptInvokeService: tenantId added to the log on script invocation blocked
pull/9223/head^2
Andrew Shvayka 3 years ago
committed by GitHub
parent
commit
d41f830db6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      common/script/script-api/src/main/java/org/thingsboard/script/api/AbstractScriptInvokeService.java

4
common/script/script-api/src/main/java/org/thingsboard/script/api/AbstractScriptInvokeService.java

@ -150,7 +150,7 @@ public abstract class AbstractScriptInvokeService implements ScriptInvokeService
} }
apiUsageReportClient.ifPresent(client -> client.report(tenantId, customerId, ApiUsageRecordKey.JS_EXEC_COUNT, 1)); apiUsageReportClient.ifPresent(client -> client.report(tenantId, customerId, ApiUsageRecordKey.JS_EXEC_COUNT, 1));
pushedMsgs.incrementAndGet(); pushedMsgs.incrementAndGet();
log.trace("InvokeScript uuid {} with timeout {}ms", scriptId, getMaxInvokeRequestsTimeout()); log.trace("[{}] InvokeScript uuid {} with timeout {}ms", tenantId, scriptId, getMaxInvokeRequestsTimeout());
var task = doInvokeFunction(scriptId, args); var task = doInvokeFunction(scriptId, args);
var resultFuture = Futures.transformAsync(task.getResultFuture(), output -> { var resultFuture = Futures.transformAsync(task.getResultFuture(), output -> {
@ -167,7 +167,7 @@ public abstract class AbstractScriptInvokeService implements ScriptInvokeService
} else { } else {
String message = "Script invocation is blocked due to maximum error count " String message = "Script invocation is blocked due to maximum error count "
+ getMaxErrors() + ", scriptId " + scriptId + "!"; + getMaxErrors() + ", scriptId " + scriptId + "!";
log.warn(message); log.warn("[{}] " + message, tenantId);
return error(message); return error(message);
} }
} else { } else {

Loading…
Cancel
Save