I have a bunch of lua scripts that have lot of code in common. What are some of the ways once can reduce code duplication?
I tried using the require keyword, and even tried calling evalsha from my lua scripts, but those approaches did not work.
When I use require, I get the following error:
@enable_strict_lua:15: user_script:31: Script attempted to access nonexistent global variable 'require'
When I registered the common script and tried using the sha1 in an evalsha command from within my lua script, I get the error message :
All I am looking to do is avoid code duplication in the redis lua scripts and improve maintainability. Ideas/suggestions appreciated.