AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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