moved deletion of msgs in GxsTransport inside the service thread

This commit is contained in:
csoler 2017-06-04 18:37:38 +02:00
parent 861dab32a5
commit 831b560780
2 changed files with 33 additions and 5 deletions

View file

@ -159,7 +159,7 @@ private:
* Two weeks seems fair ATM.
*/
static const uint32_t GXS_STORAGE_PERIOD = 0x127500;
static const uint32_t MAX_DELAY_BETWEEN_CLEANUPS = 1203; // every 20 mins. Could be less.
static const uint32_t MAX_DELAY_BETWEEN_CLEANUPS = 120; // every 20 mins. Could be less.
time_t mLastMsgCleanup ;
@ -282,16 +282,20 @@ private:
enum CheckState { CheckStart, CheckChecking };
public:
GxsTransIntegrityCleanupThread(RsGeneralDataService *const dataService): mDs(dataService) {}
GxsTransIntegrityCleanupThread(RsGeneralDataService *const dataService): mDs(dataService),mMtx("GxsTransIntegrityCheck") {}
bool isDone();
void run();
void getDeletedIds(std::list<RsGxsGroupId>& grpIds, std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >& msgIds);
private:
void getMessagesToDelete(GxsMsgReq& req) ;
private:
RsGeneralDataService* const mDs;
RsMutex mMtx ;
GxsMsgReq mMsgToDel ;
};
GxsTransIntegrityCleanupThread *mCleanupThread ;