mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Pop oldest jid if we hit the jid_forward_cache_hwm
This commit is contained in:
parent
46c097389c
commit
30f9d08aa8
@ -2313,6 +2313,11 @@ class MultiSyndic(MinionBase):
|
||||
if event['data']['jid'] not in self.jid_forward_cache:
|
||||
fstr = '{0}.get_load'.format(self.opts['master_job_cache'])
|
||||
self.jid_forward_cache.add(event['data']['jid'])
|
||||
if len(self.jid_forward_cache) > self.opts['syndic_jid_forward_cache_hwm']:
|
||||
# Pop the oldest jid from the cache
|
||||
tmp = sorted(list(self.jid_forward_cache))
|
||||
tmp.pop(0)
|
||||
self.jid_forward_cache = set(tmp)
|
||||
jdict['__load__'].update(
|
||||
self.mminion.returners[fstr](event['data']['jid'])
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user