[skip ci] Add comment for CheckCtxValid (#13202)

Signed-off-by: shaoyue.chen <shaoyue.chen@zilliz.com>
pull/13213/head
shaoyue 2021-12-10 21:59:30 +08:00 committed by GitHub
parent 2f94f3820f
commit ae00a0a22b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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
}