Skip to content

Commit

Permalink
- test log
Browse files Browse the repository at this point in the history
  • Loading branch information
psmagin committed Jun 21, 2024
1 parent 2171d59 commit b3ac35c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public TenantScopedExecutionService(FolioExecutionContext executionContext,

public <T> T executeTenantScoped(String tenantId, Callable<T> action) {
Map<String, Collection<String>> headers = executionContext == null ? emptyMap() : executionContext.getAllHeaders();
log.info("Context: {}", executionContext);
log.info("Headers: {}", headers);
try (var fex = new FolioExecutionContextSetter(contextBuilder.buildContext(tenantId, headers))) {
log.info("Executing tenant scoped action [tenant={}]", tenantId);
return action.call();
Expand All @@ -61,7 +63,8 @@ protected static class TenantScopedExecutionContextBuilder extends ExecutionCont
}

public FolioExecutionContext buildContext(String tenantId, Map<String, Collection<String>> headers) {
Map<String, Collection<String>> newHeaders = new HashMap<>(headers);
log.info("Tenant scoped execution context [tenant={}, headers={}]", tenantId, headers);
Map<String, Collection<String>> newHeaders = headers == null ? new HashMap<>() : new HashMap<>(headers);
if (isNotBlank(tenantId)) {
newHeaders.put(XOkapiHeaders.TENANT, singleton(tenantId));
}
Expand Down

0 comments on commit b3ac35c

Please sign in to comment.