我有一个使用 Redis 进行数据管理的 python (Flask) 平台。 https://github.com/murphyt7/projectHandover/blob/master/app.py
问题是,当我重新启动 app.py 时,所有信息都丢失了。我听说在那之前运行 BGSAVE 命令可以解决问题,但问题是服务重启是不可预测的。
有没有办法以持久的方式自动保存数据?
最佳答案
除非你强行杀死 redis,否则你的数据不应该消失。然而,这...
第 27 行:
postRedisDB.flushall()
FLUSHALL :
Delete all the keys of all the existing databases, not just the currently selected one. This command never fails.
关于python - 停止服务时 Redis 数据丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29537777/