Merge pull request #40385 from stefan-walluhn/develop

Fix 'clean_pub_auth' maintenance job
This commit is contained in:
Nicole Thomas 2017-03-31 09:03:14 -06:00 committed by GitHub
commit 5f2a19470f
2 changed files with 3 additions and 3 deletions

View File

@ -180,7 +180,8 @@ def clean_pub_auth(opts):
auth_file_path = os.path.join(dirpath, auth_file)
if not os.path.isfile(auth_file_path):
continue
if os.path.getmtime(auth_file_path) - time.time() > opts['keep_jobs']:
if (time.time() - os.path.getmtime(auth_file_path) >
(opts['keep_jobs'] * 3600)):
os.remove(auth_file_path)
except (IOError, OSError):
log.error('Unable to delete pub auth file')

View File

@ -225,8 +225,6 @@ class Maintenance(SignalHandlingMultiprocessingProcess):
last = int(time.time())
# Clean out the fileserver backend cache
salt.daemons.masterapi.clean_fsbackend(self.opts)
# Clean out pub auth
salt.daemons.masterapi.clean_pub_auth(self.opts)
old_present = set()
while True:
@ -234,6 +232,7 @@ class Maintenance(SignalHandlingMultiprocessingProcess):
if (now - last) >= self.loop_interval:
salt.daemons.masterapi.clean_old_jobs(self.opts)
salt.daemons.masterapi.clean_expired_tokens(self.opts)
salt.daemons.masterapi.clean_pub_auth(self.opts)
self.handle_search(now, last)
self.handle_git_pillar()
self.handle_schedule()