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

8 lines
240 B
SQL

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