salix/db/routines/cache/procedures/cacheCalc_clean.sql

8 lines
242 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`cacheCalc_clean`()
BEGIN
DECLARE vCleanTime DATETIME DEFAULT TIMESTAMPADD(MINUTE, -5, NOW());
DELETE FROM cache_calc WHERE expires < vCleanTime;
END$$
DELIMITER ;