Skip to content

Commit

Permalink
Merge pull request #1076 from gobitfly/BEDS-397/gas_limit_alerts_3
Browse files Browse the repository at this point in the history
fix(notifications): track history of gas limit alerts
  • Loading branch information
peterbitfly authored Nov 4, 2024
2 parents 7acad3c + 5f63b8c commit a7ed988
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions backend/pkg/notification/queuing.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,21 @@ func ExportNotificationHistory(epoch uint64, notificationsByUserID types.Notific
for group, notifications := range notificationsPerGroup {
for eventName, notifications := range notifications {
// handle all dashboard related notifications
if eventName != types.NetworkLivenessIncreasedEventName && !types.IsUserIndexed(eventName) && !types.IsMachineNotification(eventName) {
if eventName == types.NetworkLivenessIncreasedEventName || eventName == types.NetworkGasAboveThresholdEventName || eventName == types.NetworkGasBelowThresholdEventName { // handle network liveness increased events
for range notifications {
_, err := networktNotificationHistoryInsertStmt.Exec(
userID,
epoch,
utils.Config.Chain.ClConfig.DepositChainID,
eventName,
0,
epochTs,
)
if err != nil {
log.Error(err, "error inserting into network notifications history", 0)
}
}
} else if eventName != types.NetworkLivenessIncreasedEventName && !types.IsUserIndexed(eventName) && !types.IsMachineNotification(eventName) {
details, err := GetNotificationDetails(notifications)
if err != nil {
log.Error(err, "error getting notification details", 0)
Expand Down Expand Up @@ -223,20 +237,6 @@ func ExportNotificationHistory(epoch uint64, notificationsByUserID types.Notific
log.Error(err, "error inserting into client notifications history", 0)
}
}
} else if eventName == types.NetworkLivenessIncreasedEventName || eventName == types.NetworkGasAboveThresholdEventName || eventName == types.NetworkGasBelowThresholdEventName { // handle network liveness increased events
for range notifications {
_, err := networktNotificationHistoryInsertStmt.Exec(
userID,
epoch,
utils.Config.Chain.Name,
eventName,
0,
epochTs,
)
if err != nil {
log.Error(err, "error inserting into network notifications history", 0)
}
}
}
}
}
Expand Down

0 comments on commit a7ed988

Please sign in to comment.