17 lines
330 B
MySQL
17 lines
330 B
MySQL
|
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 ;
|