Skip to content

Commit

Permalink
Add debug logging for config file load
Browse files Browse the repository at this point in the history
  • Loading branch information
willmostly authored Oct 23, 2023
1 parent 03601a2 commit 67d5d76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public String findRoutingGroup(HttpServletRequest request) {
try {
BasicFileAttributes attr = Files.readAttributes(Path.of(rulesConfigPath),
BasicFileAttributes.class);
log.debug("File modified time: " + attr.lastModifiedTime() + ". lastUpdatedTime: " + lastUpdatedTime);
if (attr.lastModifiedTime().toMillis() > lastUpdatedTime) {
Lock writeLock = readWriteLock.writeLock();
writeLock.lock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public void testByRoutingRulesEngineFileChange() throws Exception {
FileWriter fw = new FileWriter(file);
fw.write(
"---\n"
+ "name: \"airflow\"\n"
+ "description: \"if query from airflow, route to etl group\"\n"
+ "name: \"airflow1\"\n"
+ "description: \"original rule\"\n"
+ "condition: \"request.getHeader(\\\"X-Trino-Source\\\") == \\\"airflow\\\"\"\n"
+ "actions:\n"
+ " - \"result.put(\\\"routingGroup\\\", \\\"etl\\\")\"");
Expand All @@ -114,8 +114,8 @@ public void testByRoutingRulesEngineFileChange() throws Exception {
fw = new FileWriter(file);
fw.write(
"---\n"
+ "name: \"airflow\"\n"
+ "description: \"if query from airflow, route to etl group\"\n"
+ "name: \"airflow2\"\n"
+ "description: \"updated rule\"\n"
+ "condition: \"request.getHeader(\\\"X-Trino-Source\\\") == \\\"airflow\\\"\"\n"
+ "actions:\n"
+ " - \"result.put(\\\"routingGroup\\\", \\\"etl2\\\")\""); // change from etl to etl2
Expand Down

0 comments on commit 67d5d76

Please sign in to comment.