mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #40385 from stefan-walluhn/develop
Fix 'clean_pub_auth' maintenance job
This commit is contained in:
commit
5f2a19470f
@ -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')
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user