mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Fix plugin reloading from PluginWatchThread
This commit is contained in:
@@ -264,6 +264,7 @@ object PluginRegistry {
|
|||||||
|
|
||||||
(extraJars ++ pluginJars).foreach { pluginJar =>
|
(extraJars ++ pluginJars).foreach { pluginJar =>
|
||||||
val installedJar = new File(installedDir, pluginJar.getName)
|
val installedJar = new File(installedDir, pluginJar.getName)
|
||||||
|
|
||||||
FileUtils.copyFile(pluginJar, installedJar)
|
FileUtils.copyFile(pluginJar, installedJar)
|
||||||
|
|
||||||
logger.info(s"Initialize ${pluginJar.getName}")
|
logger.info(s"Initialize ${pluginJar.getName}")
|
||||||
@@ -400,13 +401,16 @@ class PluginWatchThread(context: ServletContext, dir: String) extends Thread wit
|
|||||||
events.foreach { event =>
|
events.foreach { event =>
|
||||||
logger.info(event.kind + ": " + event.context)
|
logger.info(event.kind + ": " + event.context)
|
||||||
}
|
}
|
||||||
|
new Thread {
|
||||||
|
override def run(): Unit = {
|
||||||
gitbucket.core.servlet.Database() withTransaction { session =>
|
gitbucket.core.servlet.Database() withTransaction { session =>
|
||||||
logger.info("Reloading plugins...")
|
logger.info("Reloading plugins...")
|
||||||
PluginRegistry.reload(context, loadSystemSettings(), session.conn)
|
PluginRegistry.reload(context, loadSystemSettings(), session.conn)
|
||||||
logger.info("Reloading finished.")
|
logger.info("Reloading finished.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
detectedWatchKey.reset()
|
detectedWatchKey.reset()
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user