Skip to content

Commit

Permalink
[#227] Fixed script no updating on change
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Grigorev committed Jul 21, 2024
1 parent 65f4fb9 commit 5c827bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public Module loadModule(final String moduleId,

// TODO check moduleTypeUri

return PipelineFactory.loadPipeline(scriptsRepository.getResource(resourceUri, resourceContextUri));
return PipelineFactory.loadModule(scriptsRepository.getResource(resourceUri, resourceContextUri));
}

public Module loadFunction(String functionId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.*;
import java.net.URL;
import java.util.*;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -222,7 +220,13 @@ private Model runModule(final Model inputDataModel, final MultiValueMap<String,

ExecutionEngine engine = createExecutionEngine(configModel);
ContextLoaderHelper.updateContextsIfNecessary(scriptManager);
Module module = PipelineFactory.loadModule(configModel.createResource(id));
Module module = null;
try {
module = scriptManager.loadModule(id, null, null);
}
catch (Exception e) {
module = PipelineFactory.loadModule(configModel.createResource(id));
}
if (module == null) {
throw new SPipesServiceException("Cannot load module with id=" + id);
}
Expand Down Expand Up @@ -359,7 +363,11 @@ Model loadModelFromUrl(@NotNull String modelUrl) {
private void extendBindingFromURL(VariablesBinding inputVariablesBinding, URL inputBindingURL) {
try {
final VariablesBinding vb2 = new VariablesBinding();
vb2.load(inputBindingURL.openStream(), FileUtils.langTurtle);
String path = inputBindingURL.getPath();
File file = new File(path);
InputStream is = new FileInputStream(file);
vb2.load(is, FileUtils.langTurtle);
//vb2.load(inputBindingURL.openStream(), FileUtils.langTurtle);
VariablesBinding vb3 = inputVariablesBinding.extendConsistently(vb2);
if (vb3.isEmpty()) {
LOG.debug("- no conflict between bindings loaded from '{}' and those provided in query string.",
Expand Down

0 comments on commit 5c827bd

Please sign in to comment.