diff --git a/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala b/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala index 075dfd5..3d3d597 100644 --- a/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala +++ b/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala @@ -264,6 +264,7 @@ (extraJars ++ pluginJars).foreach { pluginJar => val installedJar = new File(installedDir, pluginJar.getName) + FileUtils.copyFile(pluginJar, installedJar) logger.info(s"Initialize ${pluginJar.getName}") @@ -400,12 +401,15 @@ events.foreach { event => logger.info(event.kind + ": " + event.context) } - - gitbucket.core.servlet.Database() withTransaction { session => - logger.info("Reloading plugins...") - PluginRegistry.reload(context, loadSystemSettings(), session.conn) - logger.info("Reloading finished.") - } + new Thread { + override def run(): Unit = { + gitbucket.core.servlet.Database() withTransaction { session => + logger.info("Reloading plugins...") + PluginRegistry.reload(context, loadSystemSettings(), session.conn) + logger.info("Reloading finished.") + } + } + }.start() } detectedWatchKey.reset() }