File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ export interface ConfigurationInterface {
5555 readonly enableAutoElementClickEvents ?: boolean ,
5656 // Experimentation identifier to be set in all pings
5757 experimentationId ?: string ,
58+ // Allow the client to explicitly define the length of a session in MINUTES.
59+ readonly sessionLengthInMinutesOverride ?: number ,
5860}
5961
6062// Important: the `Configuration` should only be used internally by the Glean singleton.
@@ -69,6 +71,7 @@ export class Configuration implements ConfigurationInterface {
6971 readonly enableAutoPageLoadEvents ?: boolean ;
7072 readonly enableAutoElementClickEvents ?: boolean ;
7173 experimentationId ?: string ;
74+ readonly sessionLengthInMinutesOverride ?: number ;
7275
7376 // Debug configuration.
7477 debug : DebugOptions ;
@@ -85,6 +88,7 @@ export class Configuration implements ConfigurationInterface {
8588 this . enableAutoPageLoadEvents = config ?. enableAutoPageLoadEvents ;
8689 this . enableAutoElementClickEvents = config ?. enableAutoElementClickEvents ;
8790 this . experimentationId = config ?. experimentationId ;
91+ this . sessionLengthInMinutesOverride = config ?. sessionLengthInMinutesOverride ;
8892
8993 this . debug = { } ;
9094
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ export class CoreMetrics {
211211 if ( existingSessionId ) {
212212 try {
213213 // If the session has timed out, then we create a new session.
214- if ( isSessionInactive ( ) ) {
214+ if ( isSessionInactive ( Context . config . sessionLengthInMinutesOverride ) ) {
215215 this . generateNewSession ( ) ;
216216 }
217217 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments