From d91baf50a890570258805fde86051bd86eb96d4b Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Wed, 14 Jun 2017 13:47:05 +1200 Subject: [PATCH] Remove the session GC task and API Since 2017-02 dynamodb now can automatically and freely run garbage collection on tables. It's more cost effective and have no performance impact on sites using dynamodb as a session storage. source: https://aws.amazon.com/about-aws/whats-new/2017/02/amazon-dynamodb-now-supports-automatic-item-expiration-with-time-to-live-ttl/ --- code/Model/DynamoDbSession.php | 8 --- code/Tasks/GarbageCollectSessionCronTask.php | 57 -------------------- 2 files changed, 65 deletions(-) delete mode 100644 code/Tasks/GarbageCollectSessionCronTask.php diff --git a/code/Model/DynamoDbSession.php b/code/Model/DynamoDbSession.php index 5a39025..f77e250 100644 --- a/code/Model/DynamoDbSession.php +++ b/code/Model/DynamoDbSession.php @@ -108,12 +108,4 @@ public function register() { return $this->handler->register(); } - - /** - * Garbage collect the configured DynamoDB session table - */ - public function collect() - { - return $this->handler->garbageCollect(); - } } diff --git a/code/Tasks/GarbageCollectSessionCronTask.php b/code/Tasks/GarbageCollectSessionCronTask.php deleted file mode 100644 index 58cc255..0000000 --- a/code/Tasks/GarbageCollectSessionCronTask.php +++ /dev/null @@ -1,57 +0,0 @@ -schedule; - } - - public function output($message) - { - if (PHP_SAPI === 'cli') { - echo $message.PHP_EOL; - } else { - echo $message.'
'.PHP_EOL; - } - } - - public function process() - { - $dynamoSession = DynamoDbSession::get(); - if ($dynamoSession) { - $dynamoSession->collect(); - $this->output('DynamoDB session garbage collection finished'); - } else { - $this->output('DynamoDB session not enabled. Skipping'); - } - } -}