static void CleanupLogins ()
{
int r;
try {
Stopwatch watch = new Stopwatch ();
watch.Start ();
using (DB db = new DB ()) {
r = db.ExecuteNonQuery ("DELETE FROM login WHERE expires < now();");
}
watch.Stop ();
Logger.Log ("Maintenance: successfully cleaned up logins ({0} affected records) in {1} seconds", r, watch.Elapsed.TotalSeconds);
} catch (Exception ex) {
Logger.Log ("Maintenance: failed to cleanup logins: {0}", ex);
}
}