common: rabbit refactor
Generalize interface to allow processing of any events, not just Gitea events.
This commit is contained in:
@@ -162,9 +162,9 @@ func main() {
|
||||
checker := CreateDefaultStateChecker(*checkOnStart, req, Gitea, time.Duration(*checkIntervalHours)*time.Hour)
|
||||
go checker.ConsistencyCheckProcess()
|
||||
|
||||
listenDefs := common.ListenDefinitions{
|
||||
listenDefs := &common.RabbitMQGiteaEventsProcessor{
|
||||
Orgs: orgs,
|
||||
GitAuthor: GitAuthor,
|
||||
// GitAuthor: GitAuthor,
|
||||
Handlers: map[string]common.RequestProcessor{
|
||||
common.RequestType_PR: req,
|
||||
common.RequestType_PRSync: req,
|
||||
@@ -172,7 +172,7 @@ func main() {
|
||||
common.RequestType_PRReviewRejected: req,
|
||||
},
|
||||
}
|
||||
listenDefs.RabbitURL, _ = url.Parse(*rabbitUrl)
|
||||
listenDefs.Connection().RabbitURL, _ = url.Parse(*rabbitUrl)
|
||||
|
||||
common.PanicOnError(listenDefs.ProcessRabbitMQEvents())
|
||||
common.PanicOnError(common.ProcessRabbitMQEvents(listenDefs))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user