More
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
Start DB:
|
Backend startup quickstarat:
|
||||||
|
|
||||||
## 1. brew services start postgresql@15
|
## 1. brew services start postgresql@15
|
||||||
|
|
||||||
@@ -19,7 +19,8 @@ Start DB:
|
|||||||
make dev — Runs the API server with auto-reload via air (falls back to go run if air isn't installed).
|
make dev — Runs the API server with auto-reload via air (falls back to go run if air isn't installed).
|
||||||
|
|
||||||
## 5. Terminal 2 (Poller):
|
## 5. Terminal 2 (Poller):
|
||||||
cd /Users/kjannette/workspace/koin_ping_0.2.0/backend go run ./cmd/poller
|
cd /Users/kjannette/workspace/koin_ping_0.2.0/backend
|
||||||
|
go run ./cmd/poller
|
||||||
|
|
||||||
make poller — Builds and runs the poller.
|
make poller — Builds and runs the poller.
|
||||||
make poller-dev — Runs the poller with auto-reload.
|
make poller-dev — Runs the poller with auto-reload.
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ func main() {
|
|||||||
observer := services.NewObserverService(eth, addressModel, checkpointModel)
|
observer := services.NewObserverService(eth, addressModel, checkpointModel)
|
||||||
evaluator := services.NewEvaluatorService(
|
evaluator := services.NewEvaluatorService(
|
||||||
eth, alertRuleModel, alertEventModel, addressModel, notifConfigModel,
|
eth, alertRuleModel, alertEventModel, addressModel, notifConfigModel,
|
||||||
cfg.ResendAPIKey, cfg.EmailFrom,
|
|
||||||
)
|
)
|
||||||
digestSvc := services.NewEmailDigestService(cfg.ResendAPIKey, cfg.EmailFrom, alertEventModel, notifConfigModel)
|
digestSvc := services.NewEmailDigestService(cfg.ResendAPIKey, cfg.EmailFrom, alertEventModel, notifConfigModel)
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ type EvaluatorService struct {
|
|||||||
alertEvents *models.AlertEventModel
|
alertEvents *models.AlertEventModel
|
||||||
addresses *models.AddressModel
|
addresses *models.AddressModel
|
||||||
notifConfigs *models.NotificationConfigModel
|
notifConfigs *models.NotificationConfigModel
|
||||||
resendAPIKey string
|
|
||||||
emailFrom string
|
|
||||||
notifSem *semaphore.Weighted
|
notifSem *semaphore.Weighted
|
||||||
notifWg sync.WaitGroup
|
notifWg sync.WaitGroup
|
||||||
}
|
}
|
||||||
@@ -41,8 +39,6 @@ func NewEvaluatorService(
|
|||||||
alertEvents *models.AlertEventModel,
|
alertEvents *models.AlertEventModel,
|
||||||
addresses *models.AddressModel,
|
addresses *models.AddressModel,
|
||||||
notifConfigs *models.NotificationConfigModel,
|
notifConfigs *models.NotificationConfigModel,
|
||||||
resendAPIKey string,
|
|
||||||
emailFrom string,
|
|
||||||
) *EvaluatorService {
|
) *EvaluatorService {
|
||||||
return &EvaluatorService{
|
return &EvaluatorService{
|
||||||
eth: eth,
|
eth: eth,
|
||||||
@@ -50,8 +46,6 @@ func NewEvaluatorService(
|
|||||||
alertEvents: alertEvents,
|
alertEvents: alertEvents,
|
||||||
addresses: addresses,
|
addresses: addresses,
|
||||||
notifConfigs: notifConfigs,
|
notifConfigs: notifConfigs,
|
||||||
resendAPIKey: resendAPIKey,
|
|
||||||
emailFrom: emailFrom,
|
|
||||||
notifSem: semaphore.NewWeighted(maxConcurrentNotifications),
|
notifSem: semaphore.NewWeighted(maxConcurrentNotifications),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,13 +267,7 @@ func (s *EvaluatorService) buildNotifiers(cfg *domain.NotificationConfig) []noti
|
|||||||
notifiers = append(notifiers, ¬ifications.SlackNotifier{WebhookURL: *cfg.SlackWebhookURL})
|
notifiers = append(notifiers, ¬ifications.SlackNotifier{WebhookURL: *cfg.SlackWebhookURL})
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.Email != nil && *cfg.Email != "" {
|
// Email is delivered exclusively via the daily digest service, never real-time.
|
||||||
notifiers = append(notifiers, ¬ifications.EmailNotifier{
|
|
||||||
APIKey: s.resendAPIKey,
|
|
||||||
From: s.emailFrom,
|
|
||||||
To: *cfg.Email,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return notifiers
|
return notifiers
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user