CernVM-FS
2.12.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
supervisor.cc
Go to the documentation of this file.
1
5
#include "
supervisor.h
"
6
7
#include "
util/logging.h
"
8
#include "
util/platform.h
"
9
10
Supervisor::Supervisor
(uint64_t max_retries, uint64_t interval_sec)
11
: max_retries_(max_retries), interval_(interval_sec) {}
12
13
Supervisor::~Supervisor
() {}
14
15
bool
Supervisor::Run
() {
16
uint64_t
retries
= 0;
17
uint64_t t0 =
platform_monotonic_time
();
18
bool
result =
false
;
19
do
{
20
result =
Task
();
21
uint64_t t1 =
platform_monotonic_time
();
22
if
(t1 - t0 <
interval_
) {
23
retries += 1;
24
}
else
{
25
t0 = t1;
26
retries = 0;
27
}
28
}
while
(!result && (retries <=
max_retries_
));
29
30
return
result;
31
}
Supervisor::max_retries_
uint64_t max_retries_
Definition:
supervisor.h:39
Supervisor::Task
virtual bool Task()=0
Supervisor::Run
bool Run()
Definition:
supervisor.cc:15
platform.h
logging.h
supervisor.h
Supervisor::Supervisor
Supervisor(uint64_t max_retries, uint64_t interval_sec)
Definition:
supervisor.cc:10
swissknife::anonymous_namespace{swissknife_pull.cc}::retries
unsigned retries
Definition:
swissknife_pull.cc:112
platform_monotonic_time
uint64_t platform_monotonic_time()
Definition:
platform_linux.h:328
Supervisor::~Supervisor
virtual ~Supervisor()
Definition:
supervisor.cc:13
Supervisor::interval_
uint64_t interval_
Definition:
supervisor.h:40
cvmfs
cvmfs
supervisor.cc
Generated on Sun Sep 29 2024 00:18:10 for CernVM-FS by
1.8.5