commit 4c958a5ac674c27302daa4f5e7187d9473603977
parent b0f5c28feb8d7d9722e8c7b06783277a90d3f243
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Tue, 23 May 2023 20:53:24 -0700
move code
Diffstat:
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/pkg/web/web.go b/pkg/web/web.go
@@ -349,6 +349,17 @@ func Start(db *database.DkfDB, host string, port int) {
serverError2 := make(chan struct{})
utils.SGo(func() {
+ address := host + ":" + strconv.Itoa(port)
+ logrus.Info("start tor server on " + address)
+ if err := e1.Start(address); err != nil {
+ if err != http.ErrServerClosed {
+ logrus.Error(err)
+ }
+ close(serverError1)
+ }
+ })
+
+ utils.SGo(func() {
if e2 != nil {
address := host + ":" + strconv.Itoa(port+1)
logrus.Info("start i2p server on " + address)
@@ -360,16 +371,6 @@ func Start(db *database.DkfDB, host string, port int) {
}
}
})
- utils.SGo(func() {
- address := host + ":" + strconv.Itoa(port)
- logrus.Info("start tor server on " + address)
- if err := e1.Start(address); err != nil {
- if err != http.ErrServerClosed {
- logrus.Error(err)
- }
- close(serverError1)
- }
- })
// Wait for interrupt signal to gracefully shutdown the server with
// a timeout of 10 seconds.