X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fperiodicdbmaintenance.cpp;h=073da197e92296fd7d07547abd01af6c8f2af9c4;hb=bae54a5dae027ad0a6b0126ec9eeecd3bd2739eb;hp=2ac1e07e7b33d4d4f257c4c781aaa925f0f72281;hpb=8a0a83a78390f22f99d4487cda2569909dfbc28e;p=fms.git diff --git a/src/freenet/periodicdbmaintenance.cpp b/src/freenet/periodicdbmaintenance.cpp index 2ac1e07..073da19 100644 --- a/src/freenet/periodicdbmaintenance.cpp +++ b/src/freenet/periodicdbmaintenance.cpp @@ -155,6 +155,12 @@ void PeriodicDBMaintenance::Do1DayMaintenance() date.Add(0,0,0,-2); m_db->Execute("DELETE FROM tblIdentityRequests WHERE Day<'"+date.Format("%Y-%m-%d")+"';"); + // delete old board list inserts/requests - we don't need them anymore + date.SetToGMTime(); + date.Add(0,0,0,-2); + m_db->Execute("DELETE FROM tblBoardListInserts WHERE Day<'"+date.Format("%Y-%m-%d")+"';"); + m_db->Execute("DELETE FROM tblBoardListRequests WHERE Day<'"+date.Format("%Y-%m-%d")+"';"); + // delete old local identity inserts - we don't need them anymore date.SetToGMTime(); date.Add(0,0,0,-2); @@ -239,6 +245,10 @@ void PeriodicDBMaintenance::Do1DayMaintenance() st.Bind(0,date.Format("%Y-%m-%d")); st.Step(); + // delete tblIdentityTrust for local identities and identities that have been deleted + m_db->Execute("DELETE FROM tblIdentityTrust WHERE LocalIdentityID NOT IN (SELECT LocalIdentityID FROM tblLocalIdentity);"); + m_db->Execute("DELETE FROM tblIdentityTrust WHERE IdentityID NOT IN (SELECT IdentityID FROM tblIdentity);"); + } void PeriodicDBMaintenance::Process()