DB optimization in session; AccountIndicator is now exported to xml

main
Inga 🏳‍🌈 15 years ago
parent 268934b939
commit 237e646c4d
  1. 4
      Common/dataobjects/Session.cs

@ -89,6 +89,7 @@ namespace FLocal.Common.dataobjects {
} }
public void updateLastActivity() { public void updateLastActivity() {
if(DateTime.Now.Subtract(this.lastActivity).Seconds < 30) return; //to partially remove db load
try { try {
Config.Transactional(transaction => { Config.Transactional(transaction => {
Config.instance.mainConnection.update( Config.instance.mainConnection.update(
@ -139,7 +140,8 @@ namespace FLocal.Common.dataobjects {
return new XElement("session", return new XElement("session",
new XElement("lastActivity", this.lastActivity.ToXml()), new XElement("lastActivity", this.lastActivity.ToXml()),
new XElement("sessionKey", this.sessionKey), new XElement("sessionKey", this.sessionKey),
this.account.user.exportToXmlForViewing(context) this.account.user.exportToXmlForViewing(context),
AccountIndicator.LoadByAccount(this.account).exportToXml(context)
); );
} }

Loading…
Cancel
Save