Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit a1975ae

Browse files
committed
Lower dependency resolution timeout for plugin load summary
1 parent 0475ce0 commit a1975ae

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/main/scala/org/codeoverflow/chatoverflow/framework/PluginFramework.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ class PluginFramework(pluginDirectoryPath: String) extends WithLogger {
103103
}
104104
}
105105

106-
futures.foreach(f => Await.ready(f, 10.seconds))
106+
// If plugins aren't done within this timeout they can still fetch everything in the background, they just won't be included in this summary
107+
futures.foreach(f => Await.ready(f, 5.seconds))
107108

108109
logger info s"Loaded ${pluginTypes.length} plugin types in total: " +
109110
s"${pluginTypes.map(pt => s"${pt.getName} (${pt.getAuthor})").mkString(", ")}"

src/main/scala/org/codeoverflow/chatoverflow/instance/PluginInstance.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class PluginInstance(val instanceName: String, pluginType: PluginType) extends W
100100
} else {
101101

102102
if (!areDependenciesAvailable) {
103-
logger error "Dependencies have failed to resolve and fetch."
103+
logger error "Dependencies have either failed to resolve and fetch or aren't done yet."
104104
return false
105105
}
106106

@@ -232,7 +232,7 @@ class PluginInstance(val instanceName: String, pluginType: PluginType) extends W
232232
/**
233233
* Returns whether all dependencies are resolved and fetched which is required for the plugin to start.
234234
*
235-
* @return true if all dependencies are available, true if it has failed.
235+
* @return true if all dependencies are available, false if it has failed or aren't downloaded yet.
236236
*/
237237
def areDependenciesAvailable: Boolean = {
238238
val opt = pluginType.getDependencyFuture.value

src/main/scala/org/codeoverflow/chatoverflow/ui/web/rest/plugin/PluginInstanceController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PluginInstanceController(implicit val swagger: Swagger) extends JsonServle
4747
ResultMessage(success = false, "Not all required requirements have been set.")
4848

4949
} else if (!pluginInstance.get.areDependenciesAvailable) {
50-
ResultMessage(success = false, "Dependencies have failed to resolve and fetch. Check logs for further information.")
50+
ResultMessage(success = false, "Dependencies have either failed to resolve and fetch or aren't done yet. Check logs for further information.")
5151

5252
} else if (!pluginInstance.get.start()) {
5353
ResultMessage(success = false, "Unable to start plugin.")

0 commit comments

Comments
 (0)