Home  >  Q&A  >  body text

node.js - Why is the redis in the node project still persistent if it does not meet the save conditions?

I used the ioredis library for session persistence in the node project. I used the express-session middleware. Everyone knows that this middleware uses memorySotre by default. When I use this library, I modify the code in the background to save it. , the node service restarted, and the session was lost, so I later used redis. When I modified the code and restarted, the session was no longer lost. I did not modify any of the default configuration files of redis. I just saved a key. The question is why the save conditions are not met. Logically speaking, the session will not be synchronized to the disk and the session still exists in the memory. But why does the session data still exist when the service is restarted?

滿天的星座滿天的星座2668 days ago891

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-05 11:11:52

    Have you restarted Redis

    reply
    0
  • Cancelreply