mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-27 20:00:51 +03:00
Config requests, TgUseridToClientID cache, fixes
This commit is contained in:
parent
4c6080b3fa
commit
659df606f6
6 changed files with 176 additions and 15 deletions
13
main.go
13
main.go
|
@ -263,7 +263,14 @@ func main() {
|
|||
// serves other static files
|
||||
app.GET(util.BasePath+"/static/*", echo.WrapHandler(http.StripPrefix(util.BasePath+"/static/", assetHandler)))
|
||||
|
||||
initTelegram(db, util.BuildClientConfig)
|
||||
initDeps := telegram.TgBotInitDependencies{
|
||||
DB: db,
|
||||
BuildClientConfig: util.BuildClientConfig,
|
||||
TgUseridToClientID: util.TgUseridToClientID,
|
||||
TgUseridToClientIDMutex: &util.TgUseridToClientIDMutex,
|
||||
}
|
||||
|
||||
initTelegram(initDeps)
|
||||
|
||||
if strings.HasPrefix(util.BindAddress, "unix://") {
|
||||
// Listen on unix domain socket.
|
||||
|
@ -314,10 +321,10 @@ func initServerConfig(db store.IStore, tmplDir fs.FS) {
|
|||
}
|
||||
}
|
||||
|
||||
func initTelegram(db store.IStore, buildClientConfig telegram.BuildClientConfig) {
|
||||
func initTelegram(initDeps telegram.TgBotInitDependencies) {
|
||||
go func() {
|
||||
for {
|
||||
err := telegram.Start(db, buildClientConfig)
|
||||
err := telegram.Start(initDeps)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue