mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	#835: Realtime webhooks
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user