mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 10:28:41 -05:00
Auto-expire summary index keys
This commit is contained in:
parent
6d06128481
commit
2e5fdc5200
4 changed files with 20 additions and 1 deletions
|
|
@ -302,7 +302,10 @@ describe Vmpooler::API::V1 do
|
|||
pools: [
|
||||
{'name' => 'pool1', 'size' => 5},
|
||||
{'name' => 'pool2', 'size' => 10}
|
||||
]
|
||||
],
|
||||
redis: {
|
||||
'data_ttl' => '168'
|
||||
}
|
||||
} }
|
||||
|
||||
before do
|
||||
|
|
@ -310,6 +313,7 @@ describe Vmpooler::API::V1 do
|
|||
app.settings.set :redis, redis
|
||||
|
||||
allow(redis).to receive(:exists).and_return '1'
|
||||
allow(redis).to receive(:expire).with('vmpooler__tag__' + Date.today.to_s, 604800).and_return '1'
|
||||
allow(redis).to receive(:hset).and_return '1'
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -81,11 +81,17 @@ describe 'Pool Manager' do
|
|||
end
|
||||
|
||||
context 'a host with proper summary' do
|
||||
let(:config) { {
|
||||
redis: { 'data_ttl' => '168' }
|
||||
} }
|
||||
|
||||
|
||||
before do
|
||||
allow(host).to receive(:summary).and_return true
|
||||
allow(host).to receive_message_chain(:summary, :guest).and_return true
|
||||
allow(host).to receive_message_chain(:summary, :guest, :hostName).and_return vm
|
||||
|
||||
allow(redis).to receive(:expire).with('vmpooler__boot__' + Date.today.to_s, 604800).and_return '1'
|
||||
allow(redis).to receive(:hget)
|
||||
allow(redis).to receive(:smove)
|
||||
allow(redis).to receive(:hset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue