diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2020-11-12 00:37:34 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2020-11-12 18:02:18 +0300 |
commit | 83cf8189e5f9d414efb5c5fa73227e977cf5f84d (patch) | |
tree | 095c617bd3e9b83c990e40dbd6d5f04375dd3c1f /include/persistent_data.hpp | |
parent | 9f8bfa7c6deb3808e3679d332479311dc4202819 (diff) | |
download | bmcweb-83cf8189e5f9d414efb5c5fa73227e977cf5f84d.tar.xz |
Call applySessionTimeouts before writing data
Before writing bmcweb_persistent_data.json on bmcweb shutdown call
applySessionTimeouts() to ensure no stale sessions are wrote.
To accomplish this had to move applySessionTimeouts to public.
Tested: Stop bmcweb, modify bmcweb_persistent_data.json timeout to
be 30 seconds. Start bmcweb. Verify timeout 30 seconds and
1 session is restored. Wait 1 min. stop bmcweb. Verify
no sessions in bmcweb_persistent_data.json.
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Change-Id: Idfaf7c144b3bdeb2741b48f603d7213ac1a51f10
Diffstat (limited to 'include/persistent_data.hpp')
-rw-r--r-- | include/persistent_data.hpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/persistent_data.hpp b/include/persistent_data.hpp index 0ff0c7e1df..24f7afd460 100644 --- a/include/persistent_data.hpp +++ b/include/persistent_data.hpp @@ -33,6 +33,8 @@ class ConfigFile ~ConfigFile() { + // Make sure we aren't writing stale sessions + persistent_data::SessionStore::getInstance().applySessionTimeouts(); if (persistent_data::SessionStore::getInstance().needsWrite()) { writeData(); |