Module: AWS::SessionStore::DynamoDB::GarbageCollection

Defined in:
lib/aws/session_store/dynamo_db/garbage_collection.rb

Overview

Collects and deletes unwanted sessions based on their creation and update dates.

Class Method Summary collapse

Class Method Details

.collect_garbage(options = {}) ⇒ Object

Scans DynamoDB session table to find sessions that match the max age and max stale period requirements. it then deletes all of the found sessions.



25
26
27
28
29
30
31
# File 'lib/aws/session_store/dynamo_db/garbage_collection.rb', line 25

def collect_garbage(options = {})
  config = load_config(options)
  last_key = eliminate_unwanted_sessions(config)
  while !last_key.empty?
    last_key = eliminate_unwanted_sessions(config, last_key)
  end
end