Skip to content

Commit

Permalink
feat: Update GetLLMStormTaskResult to use GetItem instead of LPopKeys…
Browse files Browse the repository at this point in the history
…Blocking for improved task result retrieval
  • Loading branch information
Laisky committed Feb 5, 2025
1 parent 934837c commit a5d694e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/db/redis/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ func (db *DB) AddLLMStormTask(ctx context.Context,
// GetLLMStormTaskResult gets the result of a LLMStormTask by taskID.
func (db *DB) GetLLMStormTaskResult(ctx context.Context, taskID string) (task *LLMStormTask, err error) {
key := KeyPrefixTaskLLMStormResult + taskID
// LPopKeysBlocking returns (usedKey, poppedValue, error)
_, val, err := db.db.LPopKeysBlocking(ctx, key)
val, err := db.db.GetItem(ctx, key)
if err != nil {
return nil, errors.Wrapf(err, "failed to get task result by key `%s`", key)
}
Expand Down

0 comments on commit a5d694e

Please sign in to comment.