1
1
mirror of https://github.com/go-gitea/gitea synced 2025-02-04 14:04:28 +00:00

some improvements

This commit is contained in:
Lunny Xiao 2024-11-25 20:45:56 -08:00
parent 1edf4f1eb1
commit 2e2c4f98f3
2 changed files with 4 additions and 3 deletions

View File

@ -404,11 +404,12 @@ func CheckPRsForBaseBranch(ctx context.Context, baseRepo *repo_model.Repository,
// Init runs the task queue to test all the checking status pull requests
func Init() error {
prPatchCheckerQueue = queue.CreateUniqueQueue(graceful.GetManager().ShutdownContext(), "pr_patch_checker", handler)
if prPatchCheckerQueue == nil {
return fmt.Errorf("unable to create pr_patch_checker queue")
}
notify_service.RegisterNotifier(newNotifier())
go graceful.GetManager().RunWithCancel(prPatchCheckerQueue)
go graceful.GetManager().RunWithShutdownContext(InitializePullRequests)
return nil

View File

@ -18,8 +18,8 @@ type pullNotifier struct {
var _ notify_service.Notifier = &pullNotifier{}
// NewNotifier create a new indexerNotifier notifier
func NewNotifier() notify_service.Notifier {
// newNotifier create a new indexerNotifier notifier
func newNotifier() notify_service.Notifier {
return &pullNotifier{}
}