Skip to content

Commit 2bd23e6

Browse files
committed
Sync with mirror on SyncPushCommits event
1 parent 436013e commit 2bd23e6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/notification/mirror/mirror.go

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ func (m *mirrorNotifier) NotifyPushCommits(pusher *user_model.User, repo *repo_m
3636
syncPushMirrorWithSyncOnCommit(ctx, repo.ID)
3737
}
3838

39+
func (m *mirrorNotifier) NotifySyncPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
40+
ctx, _, finished := process.GetManager().AddContext(graceful.GetManager().HammerContext(), fmt.Sprintf("webhook.NotifySyncPushCommits User: %s[%d] in %s[%d]", pusher.Name, pusher.ID, repo.FullName(), repo.ID))
41+
defer finished()
42+
43+
syncPushMirrorWithSyncOnCommit(ctx, repo.ID)
44+
}
45+
3946
func syncPushMirrorWithSyncOnCommit(ctx context.Context, repoID int64) {
4047
syncOnCommit := true
4148
pushMirrors, err := repo_model.GetPushMirrorsByRepoIDWithSyncOnCommit(repoID, syncOnCommit)

0 commit comments

Comments
 (0)