diff options
Diffstat (limited to 'services/repository')
-rw-r--r-- | services/repository/archiver/archiver.go | 9 | ||||
-rw-r--r-- | services/repository/push.go | 7 |
2 files changed, 7 insertions, 9 deletions
diff --git a/services/repository/archiver/archiver.go b/services/repository/archiver/archiver.go index 1c514a4112..2e3defee8d 100644 --- a/services/repository/archiver/archiver.go +++ b/services/repository/archiver/archiver.go @@ -297,7 +297,7 @@ func ArchiveRepository(request *ArchiveRequest) (*repo_model.RepoArchiver, error var archiverQueue *queue.WorkerPoolQueue[*ArchiveRequest] -// Init initlize archive +// Init initializes archiver func Init() error { handler := func(items ...*ArchiveRequest) []*ArchiveRequest { for _, archiveReq := range items { @@ -309,12 +309,11 @@ func Init() error { return nil } - archiverQueue = queue.CreateUniqueQueue("repo-archive", handler) + archiverQueue = queue.CreateUniqueQueue(graceful.GetManager().ShutdownContext(), "repo-archive", handler) if archiverQueue == nil { - return errors.New("unable to create codes indexer queue") + return errors.New("unable to create repo-archive queue") } - - go graceful.GetManager().RunWithShutdownFns(archiverQueue.Run) + go graceful.GetManager().RunWithCancel(archiverQueue) return nil } diff --git a/services/repository/push.go b/services/repository/push.go index f213948916..571eedccb3 100644 --- a/services/repository/push.go +++ b/services/repository/push.go @@ -42,12 +42,11 @@ func handler(items ...[]*repo_module.PushUpdateOptions) [][]*repo_module.PushUpd } func initPushQueue() error { - pushQueue = queue.CreateSimpleQueue("push_update", handler) + pushQueue = queue.CreateSimpleQueue(graceful.GetManager().ShutdownContext(), "push_update", handler) if pushQueue == nil { - return errors.New("unable to create push_update Queue") + return errors.New("unable to create push_update queue") } - - go graceful.GetManager().RunWithShutdownFns(pushQueue.Run) + go graceful.GetManager().RunWithCancel(pushQueue) return nil } |