Merge branch 'RED-9579-executor' into 'release/4.73.x'
RED-9579 - Use TaskExecutor so the TenantAwareTaskDecorator will correctly set... See merge request redactmanager/redaction-report-service!84
This commit is contained in:
commit
33e1198440
@ -1,9 +1,8 @@
|
||||
package com.iqser.red.service.redaction.report.v1.server.storage;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -16,10 +15,12 @@ import lombok.RequiredArgsConstructor;
|
||||
public class ReportStorageServiceAsyncWrapper {
|
||||
|
||||
private final ReportStorageService reportStorageService;
|
||||
private final Executor ioExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||
private final TaskExecutor taskExecutor;
|
||||
|
||||
|
||||
public CompletableFuture<String> storeObjectAsync(String downloadId, byte[] data) {
|
||||
return CompletableFuture.supplyAsync(() -> reportStorageService.storeObject(downloadId, data), ioExecutor);
|
||||
|
||||
return CompletableFuture.supplyAsync(() -> reportStorageService.storeObject(downloadId, data), taskExecutor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user