Merge "Added logging to start and end of audit passes."
This commit is contained in:
commit
963d158afe
@ -43,6 +43,7 @@ class AccountAuditor(Daemon):
|
|||||||
reported = time.time()
|
reported = time.time()
|
||||||
time.sleep(random() * self.interval)
|
time.sleep(random() * self.interval)
|
||||||
while True:
|
while True:
|
||||||
|
self.logger.info(_('Begin account audit pass'))
|
||||||
begin = time.time()
|
begin = time.time()
|
||||||
try:
|
try:
|
||||||
all_locs = audit_location_generator(self.devices,
|
all_locs = audit_location_generator(self.devices,
|
||||||
@ -64,10 +65,12 @@ class AccountAuditor(Daemon):
|
|||||||
elapsed = time.time() - begin
|
elapsed = time.time() - begin
|
||||||
if elapsed < self.interval:
|
if elapsed < self.interval:
|
||||||
time.sleep(self.interval - elapsed)
|
time.sleep(self.interval - elapsed)
|
||||||
|
self.logger.info(
|
||||||
|
_('Account audit pass completed: %.02fs'), elapsed)
|
||||||
|
|
||||||
def run_once(self, *args, **kwargs):
|
def run_once(self, *args, **kwargs):
|
||||||
"""Run the account audit once."""
|
"""Run the account audit once."""
|
||||||
self.logger.info('Begin account audit "once" mode')
|
self.logger.info(_('Begin account audit "once" mode'))
|
||||||
begin = reported = time.time()
|
begin = reported = time.time()
|
||||||
all_locs = audit_location_generator(self.devices,
|
all_locs = audit_location_generator(self.devices,
|
||||||
account_server.DATADIR,
|
account_server.DATADIR,
|
||||||
@ -86,7 +89,7 @@ class AccountAuditor(Daemon):
|
|||||||
self.account_failures = 0
|
self.account_failures = 0
|
||||||
elapsed = time.time() - begin
|
elapsed = time.time() - begin
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
'Account audit "once" mode completed: %.02fs', elapsed)
|
_('Account audit "once" mode completed: %.02fs'), elapsed)
|
||||||
|
|
||||||
def account_audit(self, path):
|
def account_audit(self, path):
|
||||||
"""
|
"""
|
||||||
|
@ -44,6 +44,7 @@ class ContainerAuditor(Daemon):
|
|||||||
reported = time.time()
|
reported = time.time()
|
||||||
time.sleep(random() * self.interval)
|
time.sleep(random() * self.interval)
|
||||||
while True:
|
while True:
|
||||||
|
self.logger.info(_('Begin container audit pass.'))
|
||||||
begin = time.time()
|
begin = time.time()
|
||||||
try:
|
try:
|
||||||
all_locs = audit_location_generator(self.devices,
|
all_locs = audit_location_generator(self.devices,
|
||||||
@ -66,6 +67,8 @@ class ContainerAuditor(Daemon):
|
|||||||
elapsed = time.time() - begin
|
elapsed = time.time() - begin
|
||||||
if elapsed < self.interval:
|
if elapsed < self.interval:
|
||||||
time.sleep(self.interval - elapsed)
|
time.sleep(self.interval - elapsed)
|
||||||
|
self.logger.info(
|
||||||
|
_('Container audit pass completed: %.02fs'), elapsed)
|
||||||
|
|
||||||
def run_once(self, *args, **kwargs):
|
def run_once(self, *args, **kwargs):
|
||||||
"""Run the container audit once."""
|
"""Run the container audit once."""
|
||||||
|
Loading…
Reference in New Issue
Block a user