salix/db/routines/stock/procedures/log_syncNoWait.sql

17 lines
330 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `stock`.`log_syncNoWait`()
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
DO RELEASE_LOCK('stock.log_sync');
RESIGNAL;
END;
IF GET_LOCK('stock.log_sync', 0) THEN
CALL log_sync(FALSE);
END IF;
DO RELEASE_LOCK('stock.log_sync');
END$$
DELIMITER ;