mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Fix incorrect webhook time and use relative-time to display it (#24477)
Fixes #24414 After click replay this webhook, it will display `now`  --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
4a722c9a45
commit
dbb3736785
5 changed files with 57 additions and 27 deletions
|
@ -25,6 +25,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/proxy"
|
||||
"code.gitea.io/gitea/modules/queue"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
webhook_module "code.gitea.io/gitea/modules/webhook"
|
||||
|
||||
"github.com/gobwas/glob"
|
||||
|
@ -175,7 +176,7 @@ func Deliver(ctx context.Context, t *webhook_model.HookTask) error {
|
|||
|
||||
// All code from this point will update the hook task
|
||||
defer func() {
|
||||
t.Delivered = time.Now().UnixNano()
|
||||
t.Delivered = timeutil.TimeStampNanoNow()
|
||||
if t.IsSucceed {
|
||||
log.Trace("Hook delivered: %s", t.UUID)
|
||||
} else if !w.IsActive {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue