This is an automated email from the ASF dual-hosted git repository.
tzssangglass pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/apisix-java-plugin-runner.git
The following commit(s) were added to refs/heads/main by this push:
new 58f8088 fix: hot reloading not working when java plugin runner is
started from different working directory (#180)
58f8088 is described below
commit 58f8088fc45f45c9f54676fe5f6fcbec8c6921a8
Author: Eric Liu <[email protected]>
AuthorDate: Tue Aug 9 00:41:16 2022 -0700
fix: hot reloading not working when java plugin runner is started from
different working directory (#180)
---
.../main/java/org/apache/apisix/plugin/runner/HotReloadProcess.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/runner-starter/src/main/java/org/apache/apisix/plugin/runner/HotReloadProcess.java
b/runner-starter/src/main/java/org/apache/apisix/plugin/runner/HotReloadProcess.java
index 52ecaea..11e28c2 100644
---
a/runner-starter/src/main/java/org/apache/apisix/plugin/runner/HotReloadProcess.java
+++
b/runner-starter/src/main/java/org/apache/apisix/plugin/runner/HotReloadProcess.java
@@ -108,12 +108,13 @@ public class HotReloadProcess implements
ApplicationContextAware {
final BeanDefinitionRegistry registry = (BeanDefinitionRegistry)
ctx.getAutowireCapableBeanFactory();
String userDir = System.getProperty("user.dir");
+ userDir = userDir.substring(0,
userDir.lastIndexOf("apisix-java-plugin-runner") + 25);
String workDir = userDir + loadPath;
Path path = Paths.get(workDir);
boolean exists = Files.exists(path);
if (!exists) {
- logger.warn("The filter workdir fot hot reload {} not exists",
workDir);
+ logger.warn("The filter workdir for hot reload {} not exists",
workDir);
cancelHotReload("hotReloadFilter");
return;
}