mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(confg): reload on save and refactor logging (#275)
* feat(confg): reload on save * refactor(logging): rework
This commit is contained in:
parent
198528a474
commit
91b094f4f4
56 changed files with 995 additions and 873 deletions
|
@ -3,7 +3,10 @@ package notification
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/autobrr/autobrr/internal/domain"
|
||||
"github.com/autobrr/autobrr/internal/logger"
|
||||
|
||||
"github.com/containrrr/shoutrrr"
|
||||
t "github.com/containrrr/shoutrrr/pkg/types"
|
||||
)
|
||||
|
@ -19,11 +22,13 @@ type Service interface {
|
|||
}
|
||||
|
||||
type service struct {
|
||||
log logger.Logger
|
||||
repo domain.NotificationRepo
|
||||
}
|
||||
|
||||
func NewService(repo domain.NotificationRepo) Service {
|
||||
func NewService(log logger.Logger, repo domain.NotificationRepo) Service {
|
||||
return &service{
|
||||
log: log,
|
||||
repo: repo,
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +137,7 @@ func (s *service) send(notifications []domain.Notification, event domain.EventsR
|
|||
if evt == string(event.Status) {
|
||||
switch n.Type {
|
||||
case domain.NotificationTypeDiscord:
|
||||
go discordNotification(event, n.Webhook)
|
||||
go s.discordNotification(event, n.Webhook)
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue