Merge "Fix gerrit show-queue timing out when webhooks are processed" into stable-2.14
diff --git a/src/main/java/com/googlesource/gerrit/plugins/webhooks/PostTask.java b/src/main/java/com/googlesource/gerrit/plugins/webhooks/PostTask.java
index 9a52f55..0d7fd51 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/webhooks/PostTask.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/webhooks/PostTask.java
@@ -38,6 +38,7 @@
private final ScheduledExecutorService executor;
private final Supplier<HttpSession> session;
private final RemoteConfig remote;
+ private final ProjectEvent event;
private final Supplier<Optional<EventProcessor.Request>> processor;
private int execCnt;
@@ -49,6 +50,7 @@
@Assisted ProjectEvent event,
@Assisted RemoteConfig remote) {
this.executor = executor;
+ this.event = event;
this.remote = remote;
// postpone creation of HttpSession so that it is obtained only when processor
// returns non-empty content
@@ -107,7 +109,13 @@
@Override
public String toString() {
- Optional<EventProcessor.Request> content = processor.get();
- return content.isPresent() ? content.get().toString() : "no content";
+ return new StringBuilder()
+ .append("Processing event: ")
+ .append(event.getType())
+ .append(" for project: ")
+ .append(event.getProjectNameKey().get())
+ .append(" for remote: ")
+ .append(remote.getUrl())
+ .toString();
}
}