refactor: ignore redis is nil

This commit is contained in:
ning 2023-03-31 16:20:33 +08:00
parent dc26bb78d8
commit c7c694e70b
2 changed files with 5 additions and 7 deletions

View File

@ -200,13 +200,6 @@
{{timestamp}}
</td>
</tr>
<tr>
<th>PromQL</th>
<td>
{{.PromQl}}
</td>
</tr>
</tbody>
</table>

View File

@ -2,6 +2,7 @@ package storage
import (
"context"
"errors"
"fmt"
"os"
"strings"
@ -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