File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Sources/Instrumentation/Sessions Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,8 @@ public class SessionManager {
4848 if let previousSession {
4949 SessionEventInstrumentation . addSession ( session: previousSession, eventType: . end)
5050 }
51- if previousSession != nil {
52- SessionEventInstrumentation . addSession ( session: currentSession, eventType: . start)
53- NotificationCenter . default. post ( name: SessionEventNotification, object: currentSession)
54- }
51+ SessionEventInstrumentation . addSession ( session: currentSession, eventType: . start)
52+ NotificationCenter . default. post ( name: SessionEventNotification, object: currentSession)
5553 }
5654
5755 SessionStore . scheduleSave ( session: currentSession)
@@ -65,6 +63,7 @@ public class SessionManager {
6563 }
6664
6765 /// Creates a new session with a unique identifier
66+ /// *Warning* - this must be a pure function since it is used inside a lock
6867 private func startSession( ) -> Session {
6968 let now = Date ( )
7069
@@ -78,6 +77,7 @@ public class SessionManager {
7877 }
7978
8079 /// Extends the current session expiry time
80+ /// *Warning* - this must be a pure function since it is used inside a lock
8181 private func refreshSession( session: Session ) -> Session {
8282 return Session (
8383 id: session. id,
You can’t perform that action at this time.
0 commit comments