X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Ftrustlistinserter.cpp;h=5f2fbb8fb394d8f3deab05186d18844533b594cc;hp=b22453db4053089715524a2e829bd5a88d1af00f;hb=b9c3763a932cebaa015a27fe111017f6f34dfbaa;hpb=37a8d59548287dcad78ef00e7b18058721eb9935 diff --git a/src/freenet/trustlistinserter.cpp b/src/freenet/trustlistinserter.cpp index b22453d..5f2fbb8 100644 --- a/src/freenet/trustlistinserter.cpp +++ b/src/freenet/trustlistinserter.cpp @@ -21,7 +21,13 @@ void TrustListInserter::CheckForNeededInsert() { DateTime date; date.SetToGMTime(); - date.Add(0,0,-1); + int currentday=date.GetDay(); + date.Add(0,0,-6); + // insert trust lists every 6 hours - if 6 hours ago was different day then set to midnight of current day to insert list today ASAP + if(currentday!=date.GetDay()) + { + date.Set(date.GetYear(),date.GetMonth(),currentday); + } SQLite3DB::Recordset rs=m_db->Query("SELECT LocalIdentityID, PrivateKey FROM tblLocalIdentity WHERE PrivateKey IS NOT NULL AND PrivateKey <> '' AND PublishTrustList='true' AND InsertingTrustList='false' AND (LastInsertedTrustList<='"+date.Format("%Y-%m-%d %H:%M:%S")+"' OR LastInsertedTrustList IS NULL);"); if(rs.Empty()==false)