Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sigalmaya committed Aug 1, 2022
1 parent b25104e commit 8e108d2
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions api/filters/check_blocked_clients_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ func getPayload(data string) (*types.BlockedClient, error) {
return payload, nil
}

func (b *BlockedClientsFilter) initializeBlockedClients() (err error) {
func (b *BlockedClientsFilter) initializeBlockedClients() error {
b.connectDBForBlockedClientsEvent()
err := b.getBlockedClientsList()
return err
}

func (b *BlockedClientsFilter) getBlockedClientsList() error {
blockedClientsList, err := b.repository.List(b.ctx, types.BlockedClientsType)
if err != nil {
return err
Expand All @@ -92,19 +97,6 @@ func (b *BlockedClientsFilter) initializeBlockedClients() (err error) {
b.cache.Store(blockedClient.ClientID, blockedClient)
}
return nil
}

func getBlockedClientsList(repository storage.Repository) func(ctx context.Context) []*types.BlockedClient {
return func(ctx context.Context) []*types.BlockedClient {
clientsList, err := repository.List(ctx, types.BlockedClientsType)
if err != nil {
return nil
}

blockedClients := clientsList.(*types.BlockedClients).BlockedClients
return blockedClients

}

}

Expand Down

0 comments on commit 8e108d2

Please sign in to comment.