You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.go 708B

1234567891011121314151617181920212223242526
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package actions
  4. import (
  5. "code.gitea.io/gitea/modules/graceful"
  6. "code.gitea.io/gitea/modules/log"
  7. "code.gitea.io/gitea/modules/queue"
  8. "code.gitea.io/gitea/modules/setting"
  9. notify_service "code.gitea.io/gitea/services/notify"
  10. )
  11. func Init() {
  12. if !setting.Actions.Enabled {
  13. return
  14. }
  15. jobEmitterQueue = queue.CreateUniqueQueue(graceful.GetManager().ShutdownContext(), "actions_ready_job", jobEmitterQueueHandler)
  16. if jobEmitterQueue == nil {
  17. log.Fatal("Unable to create actions_ready_job queue")
  18. }
  19. go graceful.GetManager().RunWithCancel(jobEmitterQueue)
  20. notify_service.RegisterNotifier(NewNotifier())
  21. }