Wrong remaining time displayed (#469)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-08-20 23:03:16 +02:00
committed by GitHub
parent 9f5662635c
commit 7ee84b3c96
3 changed files with 5 additions and 5 deletions

2
go.mod
View File

@@ -17,7 +17,7 @@ require (
github.com/go-playground/validator/v10 v10.9.0
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
github.com/gregdel/pushover v0.0.0-20201104094836-ddbe0c1d3a38
github.com/hako/durafmt v0.0.0-20190612201238-650ed9f29a84
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b
github.com/imdario/mergo v0.3.12
github.com/jedib0t/go-pretty/v6 v6.2.4
github.com/matcornic/hermes/v2 v2.1.0

4
go.sum
View File

@@ -704,8 +704,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
github.com/hako/durafmt v0.0.0-20190612201238-650ed9f29a84 h1:RvcDqcKLua4b/jtXez7ZVe9s6Iq5N6ujVevqY4FBQmM=
github.com/hako/durafmt v0.0.0-20190612201238-650ed9f29a84/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE=
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b h1:wDUNC2eKiL35DbLvsDhiblTUXHxcOPwQSCzi7xpQUN4=
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b/go.mod h1:VzxiSdG6j1pi7rwGm/xYI5RbtpBgM8sARDXlvEvxlu0=
github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok=
github.com/hanwen/go-fuse/v2 v2.0.3/go.mod h1:0EQM6aH2ctVpvZ6a+onrQ/vaykxh2GH7hy3e13vzTUY=
github.com/hanwen/go-fuse/v2 v2.1.0/go.mod h1:oRyA5eK+pvJyv5otpO/DgccS8y/RvYMaO00GgRLGryc=

View File

@@ -118,7 +118,7 @@ func (di *Diun) Start() error {
// Start scheduler
di.cron.Start()
log.Info().Msgf("Next run in %s (%s)",
durafmt.ParseShort(time.Until(di.cron.Entry(di.jobID).Next)).String(),
durafmt.Parse(time.Until(di.cron.Entry(di.jobID).Next)).LimitFirstN(2).String(),
di.cron.Entry(di.jobID).Next)
select {}
@@ -133,7 +133,7 @@ func (di *Diun) Run() {
defer atomic.StoreUint32(&di.locker, 0)
if di.jobID > 0 {
defer log.Info().Msgf("Next run in %s (%s)",
durafmt.ParseShort(time.Until(di.cron.Entry(di.jobID).Next)).String(),
durafmt.Parse(time.Until(di.cron.Entry(di.jobID).Next)).LimitFirstN(2).String(),
di.cron.Entry(di.jobID).Next)
}