File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
20
20
"code.gitea.io/gitea/modules/util"
21
21
api "code.gitea.io/sdk/gitea"
22
22
23
+ "github.com/Unknwon/com"
23
24
gouuid "github.com/satori/go.uuid"
24
25
)
25
26
@@ -677,9 +678,15 @@ func DeliverHooks() {
677
678
}
678
679
679
680
// Start listening on new hook requests.
680
- for repoID := range HookQueue .Queue () {
681
- log .Trace ("DeliverHooks [repo_id: %v]" , repoID )
682
- HookQueue .Remove (repoID )
681
+ for repoIDStr := range HookQueue .Queue () {
682
+ log .Trace ("DeliverHooks [repo_id: %v]" , repoIDStr )
683
+ HookQueue .Remove (repoIDStr )
684
+
685
+ repoID , err := com .StrTo (repoIDStr ).Int64 ()
686
+ if err != nil {
687
+ log .Error (4 , "Invalid repo ID: %s" , repoIDStr )
688
+ continue
689
+ }
683
690
684
691
tasks = make ([]* HookTask , 0 , 5 )
685
692
if err := x .Where ("repo_id=? AND is_delivered=?" , repoID , false ).Find (& tasks ); err != nil {
You can’t perform that action at this time.
0 commit comments