mirror of
				https://github.com/GayPizzaSpecifications/foundation.git
				synced 2025-11-04 11:39:39 +00:00 
			
		
		
		
	DevUpdateServer: Improve update code.
This commit is contained in:
		@ -2,6 +2,7 @@ package cloud.kubelet.foundation.core.devupdate
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import cloud.kubelet.foundation.core.FoundationCorePlugin
 | 
					import cloud.kubelet.foundation.core.FoundationCorePlugin
 | 
				
			||||||
import cloud.kubelet.foundation.core.Util
 | 
					import cloud.kubelet.foundation.core.Util
 | 
				
			||||||
 | 
					import cloud.kubelet.foundation.core.service.UpdateService
 | 
				
			||||||
import com.charleskorn.kaml.Yaml
 | 
					import com.charleskorn.kaml.Yaml
 | 
				
			||||||
import com.sun.net.httpserver.HttpExchange
 | 
					import com.sun.net.httpserver.HttpExchange
 | 
				
			||||||
import com.sun.net.httpserver.HttpServer
 | 
					import com.sun.net.httpserver.HttpServer
 | 
				
			||||||
@ -85,11 +86,11 @@ class DevUpdateServer(val plugin: FoundationCorePlugin) {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      exchange.respond(200, "Success.")
 | 
					      exchange.respond(200, "Success.")
 | 
				
			||||||
 | 
					      plugin.slF4JLogger.info("DevUpdate Started")
 | 
				
			||||||
 | 
					      UpdateService.updatePlugins(plugin.server.consoleSender)
 | 
				
			||||||
      plugin.server.scheduler.runTask(plugin) { ->
 | 
					      plugin.server.scheduler.runTask(plugin) { ->
 | 
				
			||||||
        plugin.slF4JLogger.info("DevUpdate Server Restart")
 | 
					 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
          plugin.server.dispatchCommand(plugin.server.consoleSender, "fupdate")
 | 
					          plugin.server.shutdown()
 | 
				
			||||||
          plugin.server.dispatchCommand(plugin.server.consoleSender, "stop")
 | 
					 | 
				
			||||||
        } catch (e: Exception) {
 | 
					        } catch (e: Exception) {
 | 
				
			||||||
          plugin.slF4JLogger.error("DevUpdate Server failed to update server.", e)
 | 
					          plugin.slF4JLogger.error("DevUpdate Server failed to update server.", e)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user