add shutdown

This commit is contained in:
YouROK
2020-11-19 10:26:29 +03:00
parent 469c145938
commit c9b2e0938d
5 changed files with 73 additions and 41 deletions

View File

@@ -1,6 +1,7 @@
package torr
import (
"os"
"sort"
"server/log"
@@ -104,3 +105,9 @@ func SetSettings(set *sets.BTSets) {
sets.SetBTSets(set)
bts.Connect()
}
func Shutdown() {
bts.Disconnect()
sets.CloseDB()
os.Exit(0)
}