Last active
December 14, 2015 09:08
-
-
Save DavidWittman/5062343 to your computer and use it in GitHub Desktop.
MySQL scheduled event to remove Keystone authentication tokens expired for over one week.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE keystone | |
-- This needs to be set in the my.cnf to persist | |
SET GLOBAL event_scheduler = 1; | |
DELIMITER $$ | |
CREATE EVENT tokenreaper | |
ON SCHEDULE EVERY 1 WEEK | |
DO BEGIN | |
DELETE FROM `token` WHERE expires <= DATE_SUB(NOW(), INTERVAL 1 WEEK); | |
END $$ | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment