-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/playbook-events
- Loading branch information
Showing
18 changed files
with
318 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
package events | ||
|
||
import ( | ||
"github.com/flanksource/incident-commander/events/eventconsumer" | ||
"github.com/jackc/pgx/v5/pgxpool" | ||
"gorm.io/gorm" | ||
) | ||
|
||
func NewCheckConsumerSync(db *gorm.DB, pgPool *pgxpool.Pool) *eventconsumer.EventConsumer { | ||
return eventconsumer.New(db, pgPool, eventQueueUpdateChannel, | ||
newEventQueueSyncConsumerFunc(syncConsumerWatchEvents["check"], addNotificationEvent, SavePlaybookRun)) | ||
func NewCheckConsumerSync() SyncEventConsumer { | ||
return SyncEventConsumer{ | ||
watchEvents: []string{EventCheckPassed, EventCheckFailed}, | ||
consumers: []SyncEventHandlerFunc{addNotificationEvent, schedulePlaybookRun}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package events | ||
|
||
import ( | ||
"github.com/flanksource/incident-commander/events/eventconsumer" | ||
"github.com/jackc/pgx/v5/pgxpool" | ||
"gorm.io/gorm" | ||
) | ||
|
||
func NewComponentConsumerSync(db *gorm.DB, pgPool *pgxpool.Pool) *eventconsumer.EventConsumer { | ||
return eventconsumer.New(db, pgPool, eventQueueUpdateChannel, | ||
newEventQueueSyncConsumerFunc(syncConsumerWatchEvents["component"], addNotificationEvent, SavePlaybookRun)) | ||
func NewComponentConsumerSync() SyncEventConsumer { | ||
return SyncEventConsumer{ | ||
watchEvents: []string{ | ||
EventComponentStatusError, | ||
EventComponentStatusHealthy, | ||
EventComponentStatusInfo, | ||
EventComponentStatusUnhealthy, | ||
EventComponentStatusWarning, | ||
}, | ||
consumers: []SyncEventHandlerFunc{addNotificationEvent, schedulePlaybookRun}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.