Cleanup old hg sessions (older than 2 days)

This commit is contained in:
Diva Canto
2013-07-14 15:47:54 -07:00
parent e33ac50388
commit b0140383da
5 changed files with 20 additions and 2 deletions

View File

@@ -66,5 +66,15 @@ namespace OpenSim.Data.MySQL
return Delete("SessionID", sessionID.ToString());
}
public void DeleteOld()
{
using (MySqlCommand cmd = new MySqlCommand())
{
cmd.CommandText = String.Format("delete from {0} where TMStamp < NOW() - INTERVAL 2 DAY", m_Realm);
ExecuteNonQuery(cmd);
}
}
}
}