[GH-ISSUE #450] [FEATURE REQUEST] choose EVAL for func (r *RDB) runScript #205

Closed
opened 2026-03-02 05:19:37 +03:00 by kerem · 5 comments
Owner

Originally created by @chenlujjj on GitHub (May 6, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/450

Originally assigned to: @hibiken on GitHub.

Is your feature request related to a problem? Please describe.
I am using this awesome lib in my work, however when I released my application to production, I found that the evalsha is forbidden in my company.

Describe the solution you'd like
Maybe we can choose to use eval or evalsha in func (r *RDB) runScript and func (r *RDB) runScriptWithErrorCode.
It can be a bool parameter in NewClient function or something.

Describe alternatives you've considered

Additional context

Originally created by @chenlujjj on GitHub (May 6, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/450 Originally assigned to: @hibiken on GitHub. **Is your feature request related to a problem? Please describe.** I am using this awesome lib in my work, however when I released my application to production, I found that the evalsha is forbidden in my company. **Describe the solution you'd like** Maybe we can choose to use `eval` or `evalsha` in `func (r *RDB) runScript` and `func (r *RDB) runScriptWithErrorCode`. It can be a bool parameter in `NewClient` function or something. **Describe alternatives you've considered** **Additional context**
kerem 2026-03-02 05:19:37 +03:00
Author
Owner

@chenlujjj commented on GitHub (May 6, 2022):

It turns out that some script calls func (r *RDB) runScript or func (r *RDB) runScriptWithErrorCode mentioned above, others call func (s *Script) Run directly, such as res, err := dequeueCmd.Run(context.Background(), r.client, keys, argv...).Result() in rdb.go.

<!-- gh-comment-id:1119315750 --> @chenlujjj commented on GitHub (May 6, 2022): It turns out that some script calls `func (r *RDB) runScript` or `func (r *RDB) runScriptWithErrorCode` mentioned above, others call `func (s *Script) Run` directly, such as `res, err := dequeueCmd.Run(context.Background(), r.client, keys, argv...).Result()` in `rdb.go`.
Author
Owner

@chenlujjj commented on GitHub (May 6, 2022):

So there woule be more work than just modifying func (r *RDB) runScript and func (r *RDB) runScriptWithErrorCode

<!-- gh-comment-id:1119316191 --> @chenlujjj commented on GitHub (May 6, 2022): So there woule be more work than just modifying `func (r *RDB) runScript` and `func (r *RDB) runScriptWithErrorCode`
Author
Owner

@chenlujjj commented on GitHub (May 6, 2022):

I have fored a repo: https://github.com/chenlujjj/asynq/tree/eval-script, and replaced all Run to Eval. It's just a quick and dirty update for my usage and should not be merged into main branch.

<!-- gh-comment-id:1119325066 --> @chenlujjj commented on GitHub (May 6, 2022): I have fored a repo: https://github.com/chenlujjj/asynq/tree/eval-script, and replaced all `Run` to `Eval`. It's just a quick and dirty update for my usage and should not be merged into main branch.
Author
Owner

@hibiken commented on GitHub (May 10, 2022):

@chenlujjj thank you for opening an issue!
Do you think you can keep using your fork?

<!-- gh-comment-id:1122372597 --> @hibiken commented on GitHub (May 10, 2022): @chenlujjj thank you for opening an issue! Do you think you can keep using your fork?
Author
Owner

@chenlujjj commented on GitHub (May 10, 2022):

@chenlujjj thank you for opening an issue! Do you think you can keep using your fork?

yes, it works now.

<!-- gh-comment-id:1122377832 --> @chenlujjj commented on GitHub (May 10, 2022): > @chenlujjj thank you for opening an issue! Do you think you can keep using your fork? yes, it works now.
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#205
No description provided.