Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/optimalize development env #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Matthew-Kulich
Copy link
Contributor

No description provided.

Copy link
Contributor

@blcham blcham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, some parts are a little confusing.

I did not get the chance to test it, but I wonder how it works if I just move a file or a directory. The other situation is when I do the following:

  1. I make copy of file A outside of the SPipes scripts dirs
  2. I modify A
  3. I restore A from backup (I just replace new A with old one from backup)


LOG.debug("Loading model from {} ...", file.toUri().toString());
Model model = loadModel(file, lang);

if (model != null) {
OntoDocManager.addSPINRelevantModel(file.toAbsolutePath().toString(), model);
}

filesModificationTime.put(file, Instant.now());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused here what filesModificationTime means here. You say it is modification time of a file, but still instead of that you put Instant.now() ... why we are not putting here the actual modification time of the file ?

Moreover, remember that we do not need to track the modification time if keepUpdated=false.

@@ -154,11 +152,11 @@ private static boolean isFileNameSupported(String fileName) {
return Arrays.stream(SUPPORTED_FILE_EXTENSIONS).anyMatch(ext -> fileName.endsWith("." + ext));
}

private static boolean wasModified(Path fileName){
private static boolean wasModifiedOrNewlyAdded(Path fileName){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, it is confusing to call something fileName if it represents file path. The file name is referred to as the last part of the file path. I suggest calling it filePath or even better file.

@Matthew-Kulich
Copy link
Contributor Author

Matthew-Kulich commented Apr 26, 2022

I did not get the chance to test it, but I wonder how it works if I just move a file or a directory.

There will be NoSuchFileException.

  • I make copy of file A outside of the SPipes scripts dirs
  • I modify A
  • I restore A from backup (I just replace new A with old one from backup)

This situation works properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants