mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #756 Fixed session cache concept:
Each new session generates an ID identifying that session, and the .rev file annotates the ID associated with each cache value. This is needed to avoid reading a value from a previous session when loading for a continuing (non-new) session. The coarse- grained approach of distinguishing new sessions from non-new sessions was insufficient.
This commit is contained in:
committed by
Klaus Basan
parent
937cdbcc55
commit
d0d1a9c8b8
@@ -162,9 +162,6 @@ namespace BlackMisc
|
||||
//! Set the flag which will cause a value to be reset when starting a new session.
|
||||
void sessionValue(const QString &key);
|
||||
|
||||
//! True if the current update is the first of a new session.
|
||||
bool isNewSession() const;
|
||||
|
||||
private:
|
||||
mutable QMutex m_mutex { QMutex::Recursive };
|
||||
bool m_updateInProgress = false;
|
||||
@@ -180,7 +177,7 @@ namespace BlackMisc
|
||||
QSet<QString> m_deferredValues;
|
||||
QSet<QString> m_admittedValues;
|
||||
QSet<QString> m_admittedQueue;
|
||||
QSet<QString> m_sessionValues;
|
||||
QMap<QString, QUuid> m_sessionValues;
|
||||
std::vector<std::promise<void>> m_promises;
|
||||
|
||||
class Session;
|
||||
@@ -190,6 +187,8 @@ namespace BlackMisc
|
||||
static QMap<QString, qint64> fromJson(const QJsonObject ×tamps);
|
||||
static QJsonArray toJson(const QSet<QString> &pins);
|
||||
static QSet<QString> fromJson(const QJsonArray &pins);
|
||||
static QJsonObject toJson(const QMap<QString, QUuid> &session);
|
||||
static QMap<QString, QUuid> sessionFromJson(const QJsonObject &session);
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user