Skip to content

Commit

Permalink
remove request on delay
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 21, 2024
1 parent f132691 commit 2aecd51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/rultor/agents/daemons/KillsDaemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ public Iterable<Directive> process(final XML xml) throws IOException {
final String name = xml.xpath("/talk/@name").get(0);
try {
Logger.info(
this, "Daemon of %s killed due to delay, code=%d",
this, "The daemon of %s has been killed due to delay, code=%d",
name, new Script("kill.sh").exec(xml)
);
} catch (final IllegalArgumentException ex) {
Logger.warn(
this, "Failed to kill the daemon of %s due to delay: %s",
this, "We failed to kill the daemon of %s due to delay: %s",
name, ex.getMessage()
);
}
return new Directives();
return new Directives().xpath("/talk/request").remove();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Iterable<Directive> process(final XML xml) throws IOException {
if (exit != 0) {
dirs.xpath("/talk/daemon/dir").remove();
Logger.warn(
this, "daemon of %s lost its directory: %s",
this, "The daemon of %s has lost its directory: %s",
xml.xpath("/talk/@name").get(0),
dir
);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/rultor/agents/daemons/WipesDaemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public WipesDaemon() {
@Override
public Iterable<Directive> process(final XML xml) {
Logger.warn(this, "daemon wiped: %s", xml.xpath("/talk/@name").get(0));
return new Directives().xpath("/talk/daemon").remove();
return new Directives()
.xpath("/talk/daemon")
.remove();
}

}

0 comments on commit 2aecd51

Please sign in to comment.