diff options
author | Diva Canto | 2013-07-14 15:47:54 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-14 15:47:54 -0700 |
commit | b0140383da21de03cb655160a2912d04c5b470e6 (patch) | |
tree | 091f9a16f9f8da857820938e093c20ac7aafad97 | |
parent | HG UAS: Moved hg-session data from memory to DB storage. This makes it so tha... (diff) | |
download | opensim-SC-b0140383da21de03cb655160a2912d04c5b470e6.zip opensim-SC-b0140383da21de03cb655160a2912d04c5b470e6.tar.gz opensim-SC-b0140383da21de03cb655160a2912d04c5b470e6.tar.bz2 opensim-SC-b0140383da21de03cb655160a2912d04c5b470e6.tar.xz |
Cleanup old hg sessions (older than 2 days)
5 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Data/IHGTravelingData.cs b/OpenSim/Data/IHGTravelingData.cs index dd89935..452af7b 100644 --- a/OpenSim/Data/IHGTravelingData.cs +++ b/OpenSim/Data/IHGTravelingData.cs | |||
@@ -54,5 +54,6 @@ namespace OpenSim.Data | |||
54 | HGTravelingData[] GetSessions(UUID userID); | 54 | HGTravelingData[] GetSessions(UUID userID); |
55 | bool Store(HGTravelingData data); | 55 | bool Store(HGTravelingData data); |
56 | bool Delete(UUID sessionID); | 56 | bool Delete(UUID sessionID); |
57 | void DeleteOld(); | ||
57 | } | 58 | } |
58 | } \ No newline at end of file | 59 | } \ No newline at end of file |
diff --git a/OpenSim/Data/MySQL/MySQLHGTravelData.cs b/OpenSim/Data/MySQL/MySQLHGTravelData.cs index 1efbfc3..e81b880 100644 --- a/OpenSim/Data/MySQL/MySQLHGTravelData.cs +++ b/OpenSim/Data/MySQL/MySQLHGTravelData.cs | |||
@@ -66,5 +66,15 @@ namespace OpenSim.Data.MySQL | |||
66 | return Delete("SessionID", sessionID.ToString()); | 66 | return Delete("SessionID", sessionID.ToString()); |
67 | } | 67 | } |
68 | 68 | ||
69 | public void DeleteOld() | ||
70 | { | ||
71 | using (MySqlCommand cmd = new MySqlCommand()) | ||
72 | { | ||
73 | cmd.CommandText = String.Format("delete from {0} where TMStamp < NOW() - INTERVAL 2 DAY", m_Realm); | ||
74 | |||
75 | ExecuteNonQuery(cmd); | ||
76 | } | ||
77 | |||
78 | } | ||
69 | } | 79 | } |
70 | } \ No newline at end of file | 80 | } \ No newline at end of file |
diff --git a/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations b/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations index a0c9ebe..b4e4422 100644 --- a/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations +++ b/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations | |||
@@ -9,6 +9,7 @@ CREATE TABLE `hg_traveling_data` ( | |||
9 | `ServiceToken` VARCHAR(255) NOT NULL DEFAULT '', | 9 | `ServiceToken` VARCHAR(255) NOT NULL DEFAULT '', |
10 | `ClientIPAddress` VARCHAR(16) NOT NULL DEFAULT '', | 10 | `ClientIPAddress` VARCHAR(16) NOT NULL DEFAULT '', |
11 | `MyIPAddress` VARCHAR(16) NOT NULL DEFAULT '', | 11 | `MyIPAddress` VARCHAR(16) NOT NULL DEFAULT '', |
12 | `TMStamp` timestamp NOT NULL, | ||
12 | PRIMARY KEY (`SessionID`), | 13 | PRIMARY KEY (`SessionID`), |
13 | KEY (`UserID`) | 14 | KEY (`UserID`) |
14 | ) ENGINE=InnoDB; | 15 | ) ENGINE=InnoDB; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 759155a..76dbc72 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -207,6 +207,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
207 | { | 207 | { |
208 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); | 208 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); |
209 | m_UAS = scene.RequestModuleInterface<IUserAgentService>(); | 209 | m_UAS = scene.RequestModuleInterface<IUserAgentService>(); |
210 | if (m_UAS == null) | ||
211 | m_UAS = new UserAgentServiceConnector(m_ThisHomeURI); | ||
212 | |||
210 | } | 213 | } |
211 | } | 214 | } |
212 | 215 | ||
@@ -573,12 +576,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
573 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) | 576 | if (uMan != null && uMan.IsLocalGridUser(obj.AgentId)) |
574 | { | 577 | { |
575 | // local grid user | 578 | // local grid user |
579 | m_UAS.LogoutAgent(obj.AgentId, obj.SessionId); | ||
576 | return; | 580 | return; |
577 | } | 581 | } |
578 | 582 | ||
579 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); | 583 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); |
580 | 584 | if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("HomeURI")) | |
581 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | ||
582 | { | 585 | { |
583 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); | 586 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); |
584 | IUserAgentService security = new UserAgentServiceConnector(url); | 587 | IUserAgentService security = new UserAgentServiceConnector(url); |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index b597cb9..b414aca 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -148,6 +148,9 @@ namespace OpenSim.Services.HypergridService | |||
148 | if (!m_GridName.EndsWith("/")) | 148 | if (!m_GridName.EndsWith("/")) |
149 | m_GridName = m_GridName + "/"; | 149 | m_GridName = m_GridName + "/"; |
150 | 150 | ||
151 | // Finally some cleanup | ||
152 | m_Database.DeleteOld(); | ||
153 | |||
151 | } | 154 | } |
152 | } | 155 | } |
153 | 156 | ||