ChangeCleanupConfig: Allow canonical web URL to be null
When the daemon is running in slave mode, the canonical web URL does not need to be set. Bug: Issue 3696 Change-Id: I62a90c284a8bef40618bae5e3c05baf75ea28ec3
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.server.config;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.gerrit.common.Nullable;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
@@ -41,7 +42,7 @@ public class ChangeCleanupConfig {
|
||||
|
||||
@Inject
|
||||
ChangeCleanupConfig(@GerritServerConfig Config cfg,
|
||||
@CanonicalWebUrl String canonicalWebUrl) {
|
||||
@CanonicalWebUrl @Nullable String canonicalWebUrl) {
|
||||
scheduleConfig = new ScheduleConfig(cfg, SECTION);
|
||||
abandonAfter = readAbandonAfter(cfg);
|
||||
abandonIfMergeable =
|
||||
@@ -61,7 +62,9 @@ public class ChangeCleanupConfig {
|
||||
if (Strings.isNullOrEmpty(abandonMessage)) {
|
||||
abandonMessage = DEFAULT_ABANDON_MESSAGE;
|
||||
}
|
||||
abandonMessage = abandonMessage.replaceAll("\\$\\{URL\\}", webUrl);
|
||||
if (!Strings.isNullOrEmpty(webUrl)) {
|
||||
abandonMessage = abandonMessage.replaceAll("\\$\\{URL\\}", webUrl);
|
||||
}
|
||||
return abandonMessage;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user