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