From fa298a2c30c358dbfa47fc123c6aca83fe9eb999 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 25 Jul 2015 21:32:04 +0800 Subject: #835: Realtime webhooks --- cmd/serve.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd/serve.go') diff --git a/cmd/serve.go b/cmd/serve.go index 3d3bb1a90c..fed65bba15 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -16,6 +16,7 @@ import ( "github.com/codegangsta/cli" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/modules/httplib" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/uuid" @@ -193,6 +194,12 @@ func runServ(c *cli.Context) { } } + // Send deliver hook request. + resp, err := httplib.Head(setting.AppUrl + setting.AppSubUrl + repoUserName + "/" + repoName + "/hooks/trigger").Response() + if err == nil { + resp.Body.Close() + } + // Update key activity. key, err := models.GetPublicKeyById(keyId) if err != nil { -- cgit v1.2.3