Browse Source

increase max commits in payload to 5

Christopher Brickley 5 years ago
parent
commit
25c8d01676
1 changed files with 5 additions and 2 deletions
  1. 5 2
      models/update.go

+ 5 - 2
models/update.go

@@ -23,6 +23,10 @@ type UpdateTask struct {
23 23
 	NewCommitId string
24 24
 }
25 25
 
26
+const (
27
+	MAX_COMMITS int = 5
28
+)
29
+
26 30
 func AddUpdateTask(task *UpdateTask) error {
27 31
 	_, err := x.Insert(task)
28 32
 	return err
@@ -132,7 +136,6 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
132 136
 
133 137
 	// if commits push
134 138
 	commits := make([]*base.PushCommit, 0)
135
-	var maxCommits = 2
136 139
 	var actEmail string
137 140
 	for e := l.Front(); e != nil; e = e.Next() {
138 141
 		commit := e.Value.(*git.Commit)
@@ -145,7 +148,7 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
145 148
 				commit.Message(),
146 149
 				commit.Author.Email,
147 150
 				commit.Author.Name})
148
-		if len(commits) >= maxCommits {
151
+		if len(commits) >= MAX_COMMITS {
149 152
 			break
150 153
 		}
151 154
 	}