aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-05-04 08:53:43 +0900
committerGitHub <noreply@github.com>2023-05-03 19:53:43 -0400
commitdbb37367854d108ebfffcac27837c0afac199a8e (patch)
treea0f962e0d6f13ad07adede0ad6066ed760fcaadb /services
parent4a722c9a45659e7732258397bbb3dd1039ea1952 (diff)
downloadgitea-dbb37367854d108ebfffcac27837c0afac199a8e.tar.gz
gitea-dbb37367854d108ebfffcac27837c0afac199a8e.zip
Fix incorrect webhook time and use relative-time to display it (#24477)
Fixes #24414 After click replay this webhook, it will display `now` ![image](https://user-images.githubusercontent.com/18380374/235559399-05a23927-13f5-442d-8f10-2c7cd24022a0.png) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'services')
-rw-r--r--services/webhook/deliver.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/webhook/deliver.go b/services/webhook/deliver.go
index e389b1f9fe..31246c1555 100644
--- a/services/webhook/deliver.go
+++ b/services/webhook/deliver.go
@@ -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 {