@@ -210,39 +210,6 @@ func notifyWatchers(e Engine, actions ...*Action) error {
210
210
}
211
211
}
212
212
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
-
246
213
if repoChanged {
247
214
permCode = make ([]bool , len (watchers ))
248
215
permIssue = make ([]bool , len (watchers ))
0 commit comments