Change store All to use channel
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
var _ LoginAttemptStore = &MetricsCollectingStore{}
|
||||
|
||||
const tickDuration = 5 * time.Second
|
||||
|
||||
type MetricsCollectingStore struct {
|
||||
@@ -89,7 +91,7 @@ func (s *MetricsCollectingStore) AddAttempt(l *models.LoginAttempt) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *MetricsCollectingStore) All() ([]models.LoginAttempt, error) {
|
||||
func (s *MetricsCollectingStore) All() (<-chan models.LoginAttempt, error) {
|
||||
return s.store.All()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user