Skip to content

Commit

Permalink
Improve FolderObserver
Browse files Browse the repository at this point in the history
It has been reported that missing model directories cause issued during startup. With this PR a directory is created when it is missing.

Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K committed Nov 10, 2024
1 parent 389f6a3 commit 681308d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ protected void addModelParser(ModelParser modelParser) {
logger.debug("Adding parser for '{}' extension", extension);
parsers.add(extension);

// check if the desired directory exists and create it if it's missing
try {
Path extensionPath = watchService.getWatchPath().resolve(extension);
Files.createDirectories(extensionPath);
} catch (IOException e) {
logger.error("Model path for extension '{}' is missing and creation failed: {}", extension, e.getMessage());
}

if (activated) {
processIgnoredPaths(extension);
readyService.markReady(new ReadyMarker(READYMARKER_TYPE, extension));
Expand Down

0 comments on commit 681308d

Please sign in to comment.