Redis Lua脚本每周都会被删除

时间:2015-10-06 07:43:58

标签: redis

我已使用SCRIPT LOAD命令将Lua脚本加载到Redis中,并使用EVALSHA执行它。但是,脚本在1周后被删除。除SCRIPT FLUSH之外还有其他方法可以删除脚本吗?脚本是否在重新启动之间持久存在?

1 个答案:

答案 0 :(得分:2)

Is there any other way other than SCRIPT FLUSH to remove the script?

For now, the answer is no.

Are the script persistence between reboots?

No:

Also, as already mentioned, restarting a Redis instance flushes the script cache, which is not persistent. However from the point of view of the client there are only two ways to make sure a Redis instance was not restarted between two different commands.

The application layer should be responsible of loading scripts to Redis after a reboot.