@@ -15,14 +15,15 @@ public class GXSessionServiceFactory
1515 static string SESSION_PASSWORD = "SESSION_PROVIDER_PASSWORD" ;
1616 static string SESSION_SCHEMA = "SESSION_PROVIDER_SCHEMA" ;
1717 static string SESSION_TABLE_NAME = "SESSION_PROVIDER_TABLE_NAME" ;
18+ static string SESSION_TIMEOUT = "SESSION_PROVIDER_SESSION_TIMEOUT" ;
1819 public static ISessionService GetProvider ( )
1920 {
2021 var instance = GXServices . Instance ? . Get ( GXServices . SESSION_SERVICE ) ;
2122 if ( instance != null )
2223 {
2324 if ( instance . Name . Equals ( REDIS , StringComparison . OrdinalIgnoreCase ) )
2425 {
25- return new GxRedisSession ( instance . Properties . Get ( SESSION_ADDRESS ) , CryptoImpl . Decrypt ( instance . Properties . Get ( SESSION_PASSWORD ) ) , instance . Properties . Get ( SESSION_INSTANCE ) ) ;
26+ return new GxRedisSession ( instance . Properties . Get ( SESSION_ADDRESS ) , CryptoImpl . Decrypt ( instance . Properties . Get ( SESSION_PASSWORD ) ) , instance . Properties . Get ( SESSION_INSTANCE ) , int . Parse ( instance . Properties . Get ( SESSION_TIMEOUT ) ) ) ;
2627 }
2728 else if ( instance . Name . Equals ( DATABASE , StringComparison . OrdinalIgnoreCase ) )
2829 {
@@ -36,17 +37,19 @@ public static ISessionService GetProvider()
3637 }
3738 public class GxRedisSession : ISessionService
3839 {
39- public GxRedisSession ( string host , string password , string instanceName )
40+ public GxRedisSession ( string host , string password , string instanceName , int sessionTimeout )
4041 {
4142 ConnectionString = $ "{ host } ";
4243 if ( ! string . IsNullOrEmpty ( password ) )
4344 {
4445 ConnectionString += $ ",password={ password } ";
4546 }
4647 InstanceName = instanceName ;
48+ SessionTimeout = sessionTimeout ;
4749 }
4850 public string ConnectionString { get ; }
4951 public string InstanceName { get ; }
52+ public int SessionTimeout { get ; }
5053
5154 public string Schema => throw new NotImplementedException ( ) ;
5255
@@ -71,6 +74,8 @@ public GxDatabaseSession(string host, string password, string schema, string tab
7174 public string TableName { get ; }
7275
7376 public string InstanceName => throw new NotImplementedException ( ) ;
77+
78+ public int SessionTimeout => throw new NotImplementedException ( ) ;
7479 }
7580
7681 public interface ISessionService
@@ -79,5 +84,6 @@ public interface ISessionService
7984 string Schema { get ; }
8085 string TableName { get ; }
8186 string InstanceName { get ; }
87+ int SessionTimeout { get ; }
8288 }
8389}
0 commit comments