first update is faster
authorVolker Birk <vb@pep-project.org>
Fri, 01 Jul 2016 17:18:13 +0200
changeset 13758bb251fab53
parent 136 57e180b99366
child 138 053a45ab31e6
first update is faster
GateKeeper.cpp
GateKeeper.h
     1.1 --- a/GateKeeper.cpp	Fri Jul 01 11:50:29 2016 +0200
     1.2 +++ b/GateKeeper.cpp	Fri Jul 01 17:18:13 2016 +0200
     1.3 @@ -115,6 +115,7 @@
     1.4      const LPCTSTR GateKeeper::updater_reg_path = _T("Software\\pEp\\Updater");
     1.5  
     1.6      const time_t GateKeeper::cycle = 7200;   // 7200 sec is 2 h
     1.7 +    const time_t GateKeeper::fraction = 10;  // first update is at 10% of cycle
     1.8      const DWORD GateKeeper::waiting = 10000; // 10000 ms is 10 sec
     1.9  
    1.10      GateKeeper::GateKeeper(CpEpCOMServerAdapterModule * self)
    1.11 @@ -150,7 +151,7 @@
    1.12              static random_device rd;
    1.13              static mt19937 gen(rd());
    1.14  
    1.15 -            uniform_int_distribution<time_t> dist(0, cycle);
    1.16 +            uniform_int_distribution<time_t> dist(0, cycle/fraction);
    1.17  
    1.18              return dist(gen);
    1.19          }
     2.1 --- a/GateKeeper.h	Fri Jul 01 11:50:29 2016 +0200
     2.2 +++ b/GateKeeper.h	Fri Jul 01 17:18:13 2016 +0200
     2.3 @@ -37,6 +37,7 @@
     2.4          static const LPCTSTR updater_reg_path;
     2.5  
     2.6          static const time_t cycle;
     2.7 +        static const time_t fraction;
     2.8          static const DWORD waiting;
     2.9  
    2.10          static time_t time_diff();