mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 03:25:11 +01:00 
			
		
		
		
	refactor: mv modules/notification/actions to services/actions
This commit is contained in:
		
							parent
							
								
									c84094011e
								
							
						
					
					
						commit
						ec020563ae
					
				| @ -12,7 +12,6 @@ import ( | ||||
| 	user_model "code.gitea.io/gitea/models/user" | ||||
| 	"code.gitea.io/gitea/modules/log" | ||||
| 	"code.gitea.io/gitea/modules/notification/action" | ||||
| 	"code.gitea.io/gitea/modules/notification/actions" | ||||
| 	"code.gitea.io/gitea/modules/notification/base" | ||||
| 	"code.gitea.io/gitea/modules/notification/indexer" | ||||
| 	"code.gitea.io/gitea/modules/notification/mail" | ||||
| @ -41,9 +40,6 @@ func NewContext() { | ||||
| 	RegisterNotifier(webhook.NewNotifier()) | ||||
| 	RegisterNotifier(action.NewNotifier()) | ||||
| 	RegisterNotifier(mirror.NewNotifier()) | ||||
| 	if setting.Actions.Enabled { | ||||
| 		RegisterNotifier(actions.NewNotifier()) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // NotifyNewWikiPage notifies creating new wiki pages to notifiers | ||||
|  | ||||
| @ -16,13 +16,19 @@ import ( | ||||
| 	actions_module "code.gitea.io/gitea/modules/actions" | ||||
| 	"code.gitea.io/gitea/modules/graceful" | ||||
| 	"code.gitea.io/gitea/modules/log" | ||||
| 	"code.gitea.io/gitea/modules/notification" | ||||
| 	"code.gitea.io/gitea/modules/queue" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| 	api "code.gitea.io/gitea/modules/structs" | ||||
| ) | ||||
| 
 | ||||
| func Init() { | ||||
| 	jobEmitterQueue = queue.CreateUniqueQueue("actions_ready_job", jobEmitterQueueHandle, new(jobUpdate)) | ||||
| 	go graceful.GetManager().RunWithShutdownFns(jobEmitterQueue.Run) | ||||
| 
 | ||||
| 	if setting.Actions.Enabled { | ||||
| 		notification.RegisterNotifier(NewNotifier()) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| func DeleteResourceOfRepository(ctx context.Context, repo *repo_model.Repository) error { | ||||
|  | ||||
| @ -23,7 +23,6 @@ import ( | ||||
| 	"code.gitea.io/gitea/modules/log" | ||||
| 	api "code.gitea.io/gitea/modules/structs" | ||||
| 	"code.gitea.io/gitea/modules/util" | ||||
| 	actions_service "code.gitea.io/gitea/services/actions" | ||||
| 	"code.gitea.io/gitea/services/convert" | ||||
| 
 | ||||
| 	"github.com/nektos/act/pkg/jobparser" | ||||
| @ -161,7 +160,7 @@ func notify(ctx context.Context, input *notifyInput) error { | ||||
| 			log.Error("FindRunJobs: %v", err) | ||||
| 		} else { | ||||
| 			for _, job := range jobs { | ||||
| 				if err := actions_service.CreateCommitStatus(ctx, job); err != nil { | ||||
| 				if err := CreateCommitStatus(ctx, job); err != nil { | ||||
| 					log.Error("CreateCommitStatus: %v", err) | ||||
| 				} | ||||
| 			} | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user