refactor: simplify model selection and attribute handling
- fix ShortAttrInfo.GetAttrValue receiver naming - replace conditional branches with switch statements - log test task parameters during validation
This commit is contained in:
parent
72e2143cb3
commit
2468ea7f31
|
|
@ -154,8 +154,7 @@ func validateBatchImportParams(params map[string]any) bool {
|
|||
func validateTestTaskParams(params map[string]any) bool {
|
||||
// Test task has optional parameters, all are valid
|
||||
// sleep_duration defaults to 60 seconds if not provided
|
||||
// TODO Add more validation logic for test task parameters if needed
|
||||
fmt.Println(params)
|
||||
fmt.Println("Test task parameters:", params)
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1264,6 +1264,14 @@ func runFuzzySearch(ctx context.Context, rdb *redis.Client, searchInput string,
|
|||
termLastPart = term[lastDotIndex+1:]
|
||||
}
|
||||
|
||||
if recommendLenType == constants.FullRecommendLength && hierarchy == constants.GridRecommendHierarchyType {
|
||||
exists, err := rdb.SIsMember(ctx, constants.RedisAllGridSetKey, termLastPart).Result()
|
||||
if err != nil || !exists {
|
||||
logger.Info(ctx, "query key by redis fuzzy search failed or term not in redis all grid set", "query_key", fuzzyInput, "exists", exists, "error", err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
switch recommendLenType {
|
||||
case constants.FullRecommendLength:
|
||||
if result.Term == "" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue