diff --git a/cmd/panel/main.go b/cmd/panel/main.go index 968087d..2ef0b38 100644 --- a/cmd/panel/main.go +++ b/cmd/panel/main.go @@ -4,7 +4,7 @@ import ( crypto_rand "crypto/rand" "encoding/binary" "fmt" - "github.com/TicketsBot/GoPanel/app/http" + app "github.com/TicketsBot/GoPanel/app/http" "github.com/TicketsBot/GoPanel/app/http/endpoints/root" "github.com/TicketsBot/GoPanel/config" "github.com/TicketsBot/GoPanel/database" @@ -20,6 +20,8 @@ import ( "github.com/getsentry/sentry-go" "github.com/rxdn/gdl/rest/request" "math/rand" + "net/http" + "net/http/pprof" "time" ) @@ -33,6 +35,8 @@ func main() { rand.Seed(time.Now().UnixNano()) } + startPprof() + config.LoadConfig() sentryOpts := sentry.ClientOptions{ @@ -74,7 +78,7 @@ func main() { rpc.PremiumClient = &c } - http.StartServer() + app.StartServer() } func ListenChat(client redis.RedisClient) { @@ -93,3 +97,14 @@ func ListenChat(client redis.RedisClient) { root.SocketsLock.RUnlock() } } + +func startPprof() { + mux := http.NewServeMux() + mux.HandleFunc("/debug/pprof/", pprof.Index) + mux.HandleFunc("/debug/pprof/{action}", pprof.Index) + mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) + + go func() { + http.ListenAndServe(":6060", mux) + }() +} diff --git a/frontend/src/components/manage/PanelCreationForm.svelte b/frontend/src/components/manage/PanelCreationForm.svelte index 2d06e30..fbc7adc 100644 --- a/frontend/src/components/manage/PanelCreationForm.svelte +++ b/frontend/src/components/manage/PanelCreationForm.svelte @@ -314,8 +314,8 @@ teams: [], button_style: "1", form_id: "null", - channel_id: channels.find((c) => c.type === 0).id, - category_id: channels.find((c) => c.type === 4).id, + channel_id: channels.find((c) => c.type === 0)?.id, + category_id: channels.find((c) => c.type === 4)?.id, use_server_default_naming_scheme: true, }; } else { diff --git a/go.sum b/go.sum index cde79e1..b05031c 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,6 @@ github.com/TicketsBot/archiverclient v0.0.0-20220326163414-558fd52746dc h1:n15W8 github.com/TicketsBot/archiverclient v0.0.0-20220326163414-558fd52746dc/go.mod h1:2KcfHS0JnSsgcxZBs3NyWMXNQzEo67mBSGOyzHPWOCc= github.com/TicketsBot/common v0.0.0-20220703211704-f792aa9f0c42 h1:3/qnbrEfL8gqSbjJ4o7WKkdoPngmhjAGEXFwteEjpqs= github.com/TicketsBot/common v0.0.0-20220703211704-f792aa9f0c42/go.mod h1:WxHh6bY7KhIqdayeOp5f0Zj2NNi/7QqCQfMEqHnpdAM= -github.com/TicketsBot/database v0.0.0-20220710120946-a97157c1ca8c h1:WD3W0cUkIpMI5XUoGDQ88uYJnljZXxqv0e9TWCt6MqI= -github.com/TicketsBot/database v0.0.0-20220710120946-a97157c1ca8c/go.mod h1:F57cywrZsnper1cy56Bx0c/HEsxQBLHz3Pl98WXblWw= github.com/TicketsBot/database v0.0.0-20220710122820-0fdcde6692f0 h1:1lrgdlmyf0KFkl4Y3Cu1L6BQzKOzowoLUp/Kq/jwfvc= github.com/TicketsBot/database v0.0.0-20220710122820-0fdcde6692f0/go.mod h1:F57cywrZsnper1cy56Bx0c/HEsxQBLHz3Pl98WXblWw= github.com/TicketsBot/logarchiver v0.0.0-20220326162808-cdf0310f5e1c h1:OqGjFH6mbE6gd+NqI2ARJdtH3UUvhiAkD0r0fhGJK2s=