added entry in rsgxsnetservice to change sync params

This commit is contained in:
csoler 2016-12-04 23:26:48 +01:00
parent 5612647672
commit d2ef2248c6
5 changed files with 33 additions and 9 deletions

View file

@ -4406,9 +4406,29 @@ void RsGxsNetService::pauseSynchronisation(bool /* enabled */)
}
void RsGxsNetService::setSyncAge(uint32_t /* age */)
void RsGxsNetService::setSyncAge(const RsGxsGroupId &grpId, uint32_t age_in_secs)
{
RS_STACK_MUTEX(mNxsMutex) ;
RsGxsGrpConfig& conf(mServerGrpConfigMap[grpId]) ;
if(conf.msg_req_delay != age_in_secs)
{
conf.msg_req_delay = age_in_secs;
IndicateConfigChanged();
}
}
void RsGxsNetService::setKeepAge(const RsGxsGroupId &grpId, uint32_t age_in_secs)
{
RS_STACK_MUTEX(mNxsMutex) ;
RsGxsGrpConfig& conf(mServerGrpConfigMap[grpId]) ;
if(conf.msg_keep_delay != age_in_secs)
{
conf.msg_keep_delay = age_in_secs;
IndicateConfigChanged();
}
}
int RsGxsNetService::requestGrp(const std::list<RsGxsGroupId>& grpId, const RsPeerId& peerId)

View file

@ -103,11 +103,11 @@ public:
/*!
* Use this to set how far back synchronisation of messages should take place
* @param age the max age a sync item can to be allowed in a synchronisation
* Use this to set how far back synchronisation and storage of messages should take place
* @param age the max age a sync/storage item can to be allowed in a synchronisation
*/
// NOT IMPLEMENTED
virtual void setSyncAge(uint32_t age);
virtual void setSyncAge(const RsGxsGroupId& grpId,uint32_t age_in_secs);
virtual void setKeepAge(const RsGxsGroupId& grpId,uint32_t age_in_secs);
/*!
* pauses synchronisation of subscribed groups and request for group id

View file

@ -65,9 +65,10 @@ public:
/*!
* Use this to set how far back synchronisation of messages should take place
* @param age the max age a sync item can to be allowed in a synchronisation
* @param age in seconds the max age a sync/store item can to be allowed in a synchronisation
*/
virtual void setSyncAge(uint32_t age) = 0;
virtual void setSyncAge(const RsGxsGroupId& id,uint32_t age_in_secs) = 0;
virtual void setKeepAge(const RsGxsGroupId& id,uint32_t age_in_secs) = 0;
/*!
* Initiates a search through the network