mirror of https://github.com/milvus-io/milvus.git
[skip ci] Add comment for CheckCtxValid (#13202)
Signed-off-by: shaoyue.chen <shaoyue.chen@zilliz.com>pull/13213/head
parent
2f94f3820f
commit
ae00a0a22b
|
@ -185,6 +185,7 @@ func GetAttrByKeyFromRepeatedKV(key string, kvs []*commonpb.KeyValuePair) (strin
|
|||
return "", errors.New("key " + key + " not found")
|
||||
}
|
||||
|
||||
// CheckCtxValid check if the context is valid
|
||||
func CheckCtxValid(ctx context.Context) bool {
|
||||
return ctx.Err() != context.DeadlineExceeded && ctx.Err() != context.Canceled
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue