Skip to content

Commit

Permalink
refactor: ignore redis is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
710leo committed Mar 31, 2023
1 parent dc26bb7 commit c7c694e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 0 additions & 7 deletions etc/template/email.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,6 @@
{{timestamp}}
</td>
</tr>

<tr>
<th>PromQL:</th>
<td>
{{.PromQl}}
</td>
</tr>
</tbody>
</table>

Expand Down
5 changes: 5 additions & 0 deletions storage/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package storage

import (
"context"
"errors"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -123,6 +124,10 @@ func MGet(ctx context.Context, r Redis, keys []string) [][]byte {

for i, key := range keys {
cmd := cmds[i]
if errors.Is(cmd.Err(), redis.Nil) {
continue
}

if cmd.Err() != nil {
logger.Errorf("failed to get key: %s, err: %s", key, cmd.Err())
continue
Expand Down

0 comments on commit c7c694e

Please sign in to comment.