[PR #658] [CLOSED] Some Redis hset command parameter issues on different platform versions need to be fixed #808

Closed
opened 2026-03-02 06:05:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/658
Author: @yoanyombapro1234
Created: 5/12/2023
Status: Closed

Base: masterHead: master


📝 Commits (1)

📊 Changes

1 file changed (+3 additions, -4 deletions)

View changed files

📝 internal/rdb/rdb.go (+3 -4)

📄 Description

The Redis hset command does not support more than three parameters in certain versions
for example: asynq/internal/rdb/rdb.go [lineNumber: 96]

var enqueueCmd = redis.NewScript(`
if redis.call("EXISTS", KEYS[1]) == 1 then
	return 0
end
redis.call("HSET", KEYS[1],
           "msg", ARGV[1],
           "state", "pending",
           "pending_since", ARGV[3])
redis.call("LPUSH", KEYS[2], ARGV[2])
return 1
`)

To support some platform versions of Redis, it needs to be changed to the following content

var enqueueCmd = redis.NewScript(`
if redis.call("EXISTS", KEYS[1]) == 1 then
	return 0
end
redis.call("HSET", KEYS[1], "msg", ARGV[1])
redis.call("HSET", KEYS[1], "state", "pending")
redis.call("HSET", KEYS[1], "pending_since", ARGV[3])
redis.call("LPUSH", KEYS[2], ARGV[2])
return 1
`)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hibiken/asynq/pull/658 **Author:** [@yoanyombapro1234](https://github.com/yoanyombapro1234) **Created:** 5/12/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`84067c8`](https://github.com/hibiken/asynq/commit/84067c8b5cfe98a2882dd4b817e5b7503145ff28) feat: checkpoint ### 📊 Changes **1 file changed** (+3 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `internal/rdb/rdb.go` (+3 -4) </details> ### 📄 Description The Redis hset command does not support more than three parameters in certain versions for example: asynq/internal/rdb/rdb.go [lineNumber: 96] ```go var enqueueCmd = redis.NewScript(` if redis.call("EXISTS", KEYS[1]) == 1 then return 0 end redis.call("HSET", KEYS[1], "msg", ARGV[1], "state", "pending", "pending_since", ARGV[3]) redis.call("LPUSH", KEYS[2], ARGV[2]) return 1 `) ``` --- To support some platform versions of Redis, it needs to be changed to the following content ```go var enqueueCmd = redis.NewScript(` if redis.call("EXISTS", KEYS[1]) == 1 then return 0 end redis.call("HSET", KEYS[1], "msg", ARGV[1]) redis.call("HSET", KEYS[1], "state", "pending") redis.call("HSET", KEYS[1], "pending_since", ARGV[3]) redis.call("LPUSH", KEYS[2], ARGV[2]) return 1 `) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 06:05:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#808
No description provided.