mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-05 20:58:28 +02:00
System arch optimization
- Optimized types and definitions - Moved shutdown seq to start.go file - Moved authelia to auth/sso module - Added different auth types support (wip) - Updated proxy config structure - Added v3.1.4 to v3.1.5 auto upgrade utilities - Fixed #426 - Optimized status page UI - Added options to disable uptime montior in config
This commit is contained in:
43
src/start.go
43
src/start.go
@@ -331,6 +331,7 @@ func startupSequence() {
|
||||
|
||||
}
|
||||
|
||||
/* Finalize Startup Sequence */
|
||||
// This sequence start after everything is initialized
|
||||
func finalSequence() {
|
||||
//Start ACME renew agent
|
||||
@@ -339,3 +340,45 @@ func finalSequence() {
|
||||
//Inject routing rules
|
||||
registerBuildInRoutingRules()
|
||||
}
|
||||
|
||||
/* Shutdown Sequence */
|
||||
func ShutdownSeq() {
|
||||
SystemWideLogger.Println("Shutting down " + SYSTEM_NAME)
|
||||
SystemWideLogger.Println("Closing Netstats Listener")
|
||||
if netstatBuffers != nil {
|
||||
netstatBuffers.Close()
|
||||
}
|
||||
|
||||
SystemWideLogger.Println("Closing Statistic Collector")
|
||||
if statisticCollector != nil {
|
||||
statisticCollector.Close()
|
||||
}
|
||||
|
||||
if mdnsTickerStop != nil {
|
||||
SystemWideLogger.Println("Stopping mDNS Discoverer (might take a few minutes)")
|
||||
// Stop the mdns service
|
||||
mdnsTickerStop <- true
|
||||
}
|
||||
if mdnsScanner != nil {
|
||||
mdnsScanner.Close()
|
||||
}
|
||||
SystemWideLogger.Println("Shutting down load balancer")
|
||||
if loadBalancer != nil {
|
||||
loadBalancer.Close()
|
||||
}
|
||||
SystemWideLogger.Println("Closing Certificates Auto Renewer")
|
||||
if acmeAutoRenewer != nil {
|
||||
acmeAutoRenewer.Close()
|
||||
}
|
||||
//Remove the tmp folder
|
||||
SystemWideLogger.Println("Cleaning up tmp files")
|
||||
os.RemoveAll("./tmp")
|
||||
|
||||
//Close database
|
||||
SystemWideLogger.Println("Stopping system database")
|
||||
sysdb.Close()
|
||||
|
||||
//Close logger
|
||||
SystemWideLogger.Println("Closing system wide logger")
|
||||
SystemWideLogger.Close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user