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.



12
13
14
15
16
# File 'lib/aws/session_store/dynamo_db/garbage_collection.rb', line 12

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