mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-19 04:47:48 +00:00
fixup! Splitting code into multiple files with reasonable testing coverage.
This commit is contained in:
@@ -58,6 +58,8 @@ func NewSessionData(manager SessionManager) *SessionData {
|
|||||||
// IsDirty returns true if the session data has been modified since it was last loaded or saved.
|
// IsDirty returns true if the session data has been modified since it was last loaded or saved.
|
||||||
// This is used to optimize session saves by only writing when necessary.
|
// This is used to optimize session saves by only writing when necessary.
|
||||||
func (sd *SessionData) IsDirty() bool {
|
func (sd *SessionData) IsDirty() bool {
|
||||||
|
sd.sessionMutex.RLock()
|
||||||
|
defer sd.sessionMutex.RUnlock()
|
||||||
return sd.dirty
|
return sd.dirty
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +67,8 @@ func (sd *SessionData) IsDirty() bool {
|
|||||||
// This is used when session data hasn't changed in content but should still
|
// This is used when session data hasn't changed in content but should still
|
||||||
// trigger a session save (e.g., to ensure the cookie is re-issued).
|
// trigger a session save (e.g., to ensure the cookie is re-issued).
|
||||||
func (sd *SessionData) MarkDirty() {
|
func (sd *SessionData) MarkDirty() {
|
||||||
|
sd.sessionMutex.Lock()
|
||||||
|
defer sd.sessionMutex.Unlock()
|
||||||
sd.dirty = true
|
sd.dirty = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user