Merge "Merge branch 'stable-2.14'"
This commit is contained in:
@@ -556,10 +556,10 @@ maven_jar(
|
|||||||
|
|
||||||
maven_jar(
|
maven_jar(
|
||||||
name = "blame_cache",
|
name = "blame_cache",
|
||||||
artifact = "com/google/gitiles:blame-cache:0.2",
|
artifact = "com/google/gitiles:blame-cache:0.2-1",
|
||||||
attach_source = False,
|
attach_source = False,
|
||||||
repository = GERRIT,
|
repository = GERRIT,
|
||||||
sha1 = "519fc548df920123bce986056d2f644663665ae4",
|
sha1 = "da7977e8b140b63f18054214c1d1b86ffa6896cb",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Keep this version of Soy synchronized with the version used in Gitiles.
|
# Keep this version of Soy synchronized with the version used in Gitiles.
|
||||||
|
@@ -70,7 +70,8 @@ public class ServerInfo extends JavaScriptObject {
|
|||||||
|
|
||||||
public final native String replyTooltip() /*-{ return this.reply_tooltip; }-*/;
|
public final native String replyTooltip() /*-{ return this.reply_tooltip; }-*/;
|
||||||
|
|
||||||
public final native boolean showAssigneeInChangesTable() /*-{ return this.show_assignee_in_changes_table || false; }-*/;
|
public final native boolean
|
||||||
|
showAssigneeInChangesTable() /*-{ return this.show_assignee_in_changes_table || false; }-*/;
|
||||||
|
|
||||||
public final native int updateDelay() /*-{ return this.update_delay || 0; }-*/;
|
public final native int updateDelay() /*-{ return this.update_delay || 0; }-*/;
|
||||||
|
|
||||||
|
@@ -207,7 +207,8 @@ public class GetServerInfo implements RestReadView<ConfigResource> {
|
|||||||
boolean hasAssigneeInIndex =
|
boolean hasAssigneeInIndex =
|
||||||
indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE);
|
indexes.getSearchIndex().getSchema().hasField(ChangeField.ASSIGNEE);
|
||||||
info.showAssigneeInChangesTable =
|
info.showAssigneeInChangesTable =
|
||||||
toBoolean(cfg.getBoolean("change", "showAssigneeInChangesTable", false) && hasAssigneeInIndex);
|
toBoolean(
|
||||||
|
cfg.getBoolean("change", "showAssigneeInChangesTable", false) && hasAssigneeInIndex);
|
||||||
info.largeChange = cfg.getInt("change", "largeChange", 500);
|
info.largeChange = cfg.getInt("change", "largeChange", 500);
|
||||||
info.replyTooltip =
|
info.replyTooltip =
|
||||||
Optional.ofNullable(cfg.getString("change", null, "replyTooltip")).orElse("Reply and score")
|
Optional.ofNullable(cfg.getString("change", null, "replyTooltip")).orElse("Reply and score")
|
||||||
|
@@ -79,6 +79,7 @@ public class PluginLoader implements LifecycleListener {
|
|||||||
|
|
||||||
private final Path pluginsDir;
|
private final Path pluginsDir;
|
||||||
private final Path dataDir;
|
private final Path dataDir;
|
||||||
|
private final Path tempDir;
|
||||||
private final PluginGuiceEnvironment env;
|
private final PluginGuiceEnvironment env;
|
||||||
private final ServerInformationImpl srvInfoImpl;
|
private final ServerInformationImpl srvInfoImpl;
|
||||||
private final PluginUser.Factory pluginUserFactory;
|
private final PluginUser.Factory pluginUserFactory;
|
||||||
@@ -107,6 +108,7 @@ public class PluginLoader implements LifecycleListener {
|
|||||||
UniversalServerPluginProvider pluginFactory) {
|
UniversalServerPluginProvider pluginFactory) {
|
||||||
pluginsDir = sitePaths.plugins_dir;
|
pluginsDir = sitePaths.plugins_dir;
|
||||||
dataDir = sitePaths.data_dir;
|
dataDir = sitePaths.data_dir;
|
||||||
|
tempDir = sitePaths.tmp_dir;
|
||||||
env = pe;
|
env = pe;
|
||||||
srvInfoImpl = sii;
|
srvInfoImpl = sii;
|
||||||
pluginUserFactory = puf;
|
pluginUserFactory = puf;
|
||||||
@@ -325,8 +327,34 @@ public class PluginLoader implements LifecycleListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeStalePluginFiles() {
|
||||||
|
DirectoryStream.Filter<Path> filter =
|
||||||
|
new DirectoryStream.Filter<Path>() {
|
||||||
|
@Override
|
||||||
|
public boolean accept(Path entry) throws IOException {
|
||||||
|
return entry.getFileName().toString().startsWith("plugin_");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
try (DirectoryStream<Path> files = Files.newDirectoryStream(tempDir, filter)) {
|
||||||
|
for (Path file : files) {
|
||||||
|
log.info("Removing stale plugin file: " + file.toFile().getName());
|
||||||
|
try {
|
||||||
|
Files.delete(file);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error(
|
||||||
|
String.format(
|
||||||
|
"Failed to remove stale plugin file %s: %s",
|
||||||
|
file.toFile().getName(), e.getMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.warn("Unable to discover stale plugin files: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void start() {
|
public synchronized void start() {
|
||||||
|
removeStalePluginFiles();
|
||||||
log.info("Loading plugins from " + pluginsDir.toAbsolutePath());
|
log.info("Loading plugins from " + pluginsDir.toAbsolutePath());
|
||||||
srvInfoImpl.state = ServerInformation.State.STARTUP;
|
srvInfoImpl.state = ServerInformation.State.STARTUP;
|
||||||
rescan();
|
rescan();
|
||||||
|
Reference in New Issue
Block a user