mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-07-31 01:38:17 -04:00
Maintenance: upgrade golibs
This commit is contained in:
@@ -73,13 +73,13 @@ func _main(ctx context.Context, timeNow func() time.Time) int {
|
||||
fmt.Println(splash.Splash(buildInfo))
|
||||
|
||||
// Setup logger
|
||||
paramsReader := params.NewReader(logging.New(logging.StdLog)) // use a temporary logger
|
||||
paramsReader := params.NewReader(logging.New(logging.Settings{})) // use a temporary logger
|
||||
logLevel, logCaller, err := paramsReader.LoggerConfig()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return 1
|
||||
}
|
||||
logger := logging.New(logging.StdLog, logging.SetLevel(logLevel), logging.SetCaller(logCaller))
|
||||
logger := logging.NewParent(logging.Settings{Level: logLevel, Caller: logCaller})
|
||||
paramsReader = params.NewReader(logger)
|
||||
|
||||
notify, err := setupGotify(paramsReader, logger)
|
||||
@@ -172,20 +172,21 @@ func _main(ctx context.Context, timeNow func() time.Time) int {
|
||||
const healthServerAddr = "127.0.0.1:9999"
|
||||
isHealthy := health.MakeIsHealthy(db, net.LookupIP, logger)
|
||||
healthServer := health.NewServer(healthServerAddr,
|
||||
logger.NewChild(logging.SetPrefix("healthcheck server: ")),
|
||||
logger.NewChild(logging.Settings{Prefix: "healthcheck server: "}),
|
||||
isHealthy)
|
||||
wg.Add(1)
|
||||
go healthServer.Run(ctx, wg)
|
||||
|
||||
address := fmt.Sprintf("0.0.0.0:%d", p.listeningPort)
|
||||
uiDir := p.dir + "/ui"
|
||||
server := server.New(ctx, address, p.rootURL, uiDir, db, logger.NewChild(logging.SetPrefix("http server: ")), runner)
|
||||
serverLogger := logger.NewChild(logging.Settings{Prefix: "http server: "})
|
||||
server := server.New(ctx, address, p.rootURL, uiDir, db, serverLogger, runner)
|
||||
wg.Add(1)
|
||||
go server.Run(ctx, wg)
|
||||
notify(1, fmt.Sprintf("Launched with %d records to watch", len(records)))
|
||||
|
||||
go backupRunLoop(ctx, p.backupPeriod, p.dir, p.backupDirectory,
|
||||
logger.NewChild(logging.SetPrefix("backup: ")), timeNow)
|
||||
logger.NewChild(logging.Settings{Prefix: "backup: "}), timeNow)
|
||||
|
||||
osSignals := make(chan os.Signal, 1)
|
||||
signal.Notify(osSignals,
|
||||
|
||||
2
go.mod
2
go.mod
@@ -8,6 +8,6 @@ require (
|
||||
github.com/kyokomi/emoji v2.2.4+incompatible
|
||||
github.com/miekg/dns v1.1.40
|
||||
github.com/ovh/go-ovh v1.1.0
|
||||
github.com/qdm12/golibs v0.0.0-20210215133151-c711ebd3e56a
|
||||
github.com/qdm12/golibs v0.0.0-20210402232648-cfebf1e87d1b
|
||||
github.com/stretchr/testify v1.6.1
|
||||
)
|
||||
|
||||
4
go.sum
4
go.sum
@@ -73,8 +73,8 @@ github.com/phayes/permbits v0.0.0-20190612203442-39d7c581d2ee h1:P6U24L02WMfj9ym
|
||||
github.com/phayes/permbits v0.0.0-20190612203442-39d7c581d2ee/go.mod h1:3uODdxMgOaPYeWU7RzZLxVtJHZ/x1f/iHkBZuKJDzuY=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/qdm12/golibs v0.0.0-20210215133151-c711ebd3e56a h1:DxO9jvcQDtWgKSzxL95828kQxO6WCocP9PPpmIqGMRs=
|
||||
github.com/qdm12/golibs v0.0.0-20210215133151-c711ebd3e56a/go.mod h1:y0qNgur9dTkHK2Bb5tK0UCtYyvEiK08flVIglROmnBg=
|
||||
github.com/qdm12/golibs v0.0.0-20210402232648-cfebf1e87d1b h1:tSD0qWqssS8AUFTGmlP1JFfbLViOt7xrjIxGZ1AFacY=
|
||||
github.com/qdm12/golibs v0.0.0-20210402232648-cfebf1e87d1b/go.mod h1:y0qNgur9dTkHK2Bb5tK0UCtYyvEiK08flVIglROmnBg=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
|
||||
Reference in New Issue
Block a user