Review Findings
This commit is contained in:
parent
8b9ca2550e
commit
46ab7853fc
|
@ -42,7 +42,6 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
|||
private InternalTaskanaEngine internalTaskanaEngine;
|
||||
|
||||
public void initialize(TaskanaEngine taskanaEngine) {
|
||||
|
||||
LOGGER.info(
|
||||
"Simple history service implementation initialized with schemaName: {} ",
|
||||
taskanaEngine.getConfiguration().getSchemaName());
|
||||
|
@ -153,16 +152,19 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
|||
public void deleteHistoryEventsByTaskIds(List<String> taskIds)
|
||||
throws InvalidArgumentException, NotAuthorizedException {
|
||||
|
||||
internalTaskanaEngine.openConnection();
|
||||
internalTaskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN);
|
||||
|
||||
if (taskIds == null) {
|
||||
throw new InvalidArgumentException("List of taskIds must not be null.");
|
||||
}
|
||||
|
||||
taskHistoryEventMapper.deleteMultipleByTaskIds(taskIds);
|
||||
try {
|
||||
internalTaskanaEngine.openConnection();
|
||||
taskHistoryEventMapper.deleteMultipleByTaskIds(taskIds);
|
||||
} finally {
|
||||
|
||||
internalTaskanaEngine.returnConnection();
|
||||
internalTaskanaEngine.returnConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public TaskHistoryEvent getTaskHistoryEvent(String historyEventId)
|
||||
|
|
|
@ -46,10 +46,8 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
|||
TaskanaTransactionProvider txProvider,
|
||||
ScheduledJob scheduledJob) {
|
||||
super(taskanaEngine, txProvider, scheduledJob, true);
|
||||
if (simpleHistoryService == null) {
|
||||
simpleHistoryService = new SimpleHistoryServiceImpl();
|
||||
simpleHistoryService.initialize(taskanaEngine);
|
||||
}
|
||||
simpleHistoryService = new SimpleHistoryServiceImpl();
|
||||
simpleHistoryService.initialize(taskanaEngine);
|
||||
}
|
||||
|
||||
public static Duration getLockExpirationPeriod(TaskanaConfiguration taskanaConfiguration) {
|
||||
|
|
|
@ -30,9 +30,6 @@ class CreateHistoryEventOnClassificationDeletionAccTest extends AbstractAccTest
|
|||
|
||||
final String classificationId = "CLI:200000000000000000000000000000000015";
|
||||
|
||||
taskService.createTaskQuery().list();
|
||||
historyService.deleteHistoryEventsByTaskIds(List.of("test12"));
|
||||
|
||||
List<ClassificationHistoryEvent> events =
|
||||
historyService
|
||||
.createClassificationHistoryQuery()
|
||||
|
|
Loading…
Reference in New Issue