first update is faster

COM-121
Volker Birk 7 years ago
parent 87b944d23c
commit c9b30e0a67
  1. 3
      GateKeeper.cpp
  2. 1
      GateKeeper.h

@ -115,6 +115,7 @@ namespace pEp {
const LPCTSTR GateKeeper::updater_reg_path = _T("Software\\pEp\\Updater");
const time_t GateKeeper::cycle = 7200; // 7200 sec is 2 h
const time_t GateKeeper::fraction = 10; // first update is at 10% of cycle
const DWORD GateKeeper::waiting = 10000; // 10000 ms is 10 sec
GateKeeper::GateKeeper(CpEpCOMServerAdapterModule * self)
@ -150,7 +151,7 @@ namespace pEp {
static random_device rd;
static mt19937 gen(rd());
uniform_int_distribution<time_t> dist(0, cycle);
uniform_int_distribution<time_t> dist(0, cycle/fraction);
return dist(gen);
}

@ -37,6 +37,7 @@ namespace pEp {
static const LPCTSTR updater_reg_path;
static const time_t cycle;
static const time_t fraction;
static const DWORD waiting;
static time_t time_diff();

Loading…
Cancel
Save