Erwirb Config-Lock vor manuellem Verarbeitungslauf in der GUI
GuiBatchRunCoordinator erwirbt vor jedem Verarbeitungslauf (regulär und Mini-Lauf) einen exklusiven OS-Lock auf die Konfigurationsdatei via ConfigurationFileLockPort. Bei ConfigurationFileLockException wird ein deutscher Fehlerdialog angezeigt und der Lauf abgebrochen. In finally wird der Lock immer freigegeben. GuiStartupContext erhält das 27. Feld configurationFileLockPort; BootstrapRunner befüllt es mit einem FileChannelConfigurationAccessAdapter wenn eine Konfigurationsdatei geladen wurde. GuiBatchRunTab und GuiConfigurationEditorWorkspace reichen den Port durch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -78,6 +78,7 @@ import de.gecheckt.pdf.umbenenner.application.port.in.ResolveHistoricalDocumentC
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.ActiveDatabaseContextPort;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.AiContentSensitivity;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.BatchRunTrigger;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.ConfigurationFileLockPort;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.BatchRunTriggerResult;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.RunSummary;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.AiInvocationPort;
|
||||
@@ -974,8 +975,10 @@ public class BootstrapRunner {
|
||||
GuiPromptEditorPort promptEditorPort = buildGuiPromptEditorPort(
|
||||
loadedState.values().promptTemplateFile());
|
||||
Optional<String> contextError = initializeApplicationRunContext(configPath);
|
||||
Optional<ConfigurationFileLockPort> guiRunLockPort = Optional.empty();
|
||||
if (contextError.isEmpty()) {
|
||||
tryInitializeScheduler(configPath);
|
||||
guiRunLockPort = Optional.of(new FileChannelConfigurationAccessAdapter(configPath));
|
||||
}
|
||||
Optional<SchedulerControlUseCase> schedulerUseCase =
|
||||
guiSchedulerUseCase.map(s -> (SchedulerControlUseCase) s);
|
||||
@@ -986,7 +989,7 @@ public class BootstrapRunner {
|
||||
historicalDocumentContextPort, applicationVersion, promptEditorPort,
|
||||
historyOverviewPort, historyDetailsPort, historyResetPort, deleteHistoryPort,
|
||||
this::buildGuiPromptEditorPort, createNewDatabasePort, contextError,
|
||||
schedulerUseCase);
|
||||
schedulerUseCase, guiRunLockPort);
|
||||
} catch (GuiConfigurationLoadException e) {
|
||||
LOG.error("GUI startup: configuration could not be loaded, starting without it: {}",
|
||||
e.getMessage(), e);
|
||||
|
||||
Reference in New Issue
Block a user