Skip to content

Commit f177f16

Browse files
committed
Remove shortcut for single action
1 parent 83ef52d commit f177f16

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

models/repo_watch.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -210,39 +210,6 @@ func notifyWatchers(e Engine, actions ...*Action) error {
210210
}
211211
}
212212

213-
if len(actions) == 1 {
214-
// More efficient to just check the code and not cache
215-
for _, watcher := range watchers {
216-
if act.ActUserID == watcher.UserID {
217-
continue
218-
}
219-
220-
act.ID = 0
221-
act.UserID = watcher.UserID
222-
act.Repo.Units = nil
223-
224-
switch act.OpType {
225-
case ActionCommitRepo, ActionPushTag, ActionDeleteTag, ActionDeleteBranch:
226-
if !act.Repo.checkUnitUser(e, act.UserID, false, UnitTypeCode) {
227-
continue
228-
}
229-
case ActionCreateIssue, ActionCommentIssue, ActionCloseIssue, ActionReopenIssue:
230-
if !act.Repo.checkUnitUser(e, act.UserID, false, UnitTypeIssues) {
231-
continue
232-
}
233-
case ActionCreatePullRequest, ActionMergePullRequest, ActionClosePullRequest, ActionReopenPullRequest:
234-
if !act.Repo.checkUnitUser(e, act.UserID, false, UnitTypePullRequests) {
235-
continue
236-
}
237-
}
238-
239-
if _, err = e.InsertOne(act); err != nil {
240-
return fmt.Errorf("insert new action: %v", err)
241-
}
242-
}
243-
return nil
244-
}
245-
246213
if repoChanged {
247214
permCode = make([]bool, len(watchers))
248215
permIssue = make([]bool, len(watchers))

0 commit comments

Comments
 (0)