mirror of
https://github.com/bakito/adguardhome-sync.git
synced 2024-09-20 14:56:13 +08:00
start funOnStart async
This commit is contained in:
parent
0a5f6a4750
commit
620f555c90
|
@ -54,12 +54,24 @@ func Sync(cfg *types.Config) error {
|
|||
}
|
||||
}
|
||||
if cfg.RunOnStart {
|
||||
go func() {
|
||||
l.Info("Running sync on startup")
|
||||
w.sync()
|
||||
}()
|
||||
}
|
||||
if cfg.API.Port != 0 {
|
||||
if cfg.RunOnStart {
|
||||
go func() {
|
||||
l.Info("Running sync on startup")
|
||||
w.sync()
|
||||
}()
|
||||
}
|
||||
w.listenAndServe()
|
||||
} else if cfg.RunOnStart {
|
||||
l.Info("Running sync on startup")
|
||||
w.sync()
|
||||
}
|
||||
if cfg.API.Port != 0 {
|
||||
w.listenAndServe()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue