refactor: ignore redis is nil
This commit is contained in:
parent
dc26bb78d8
commit
c7c694e70b
|
@ -200,13 +200,6 @@
|
|||
{{timestamp}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>PromQL:</th>
|
||||
<td>
|
||||
{{.PromQl}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue