fix: refs #7931 Apply PR change requests
gitea/salix/pipeline/pr-test There was a failure building this commit Details

This commit is contained in:
Juan Ferrer 2024-09-06 09:06:00 +02:00
parent a7bc58a5bc
commit 640b45ed99
1 changed files with 11 additions and 3 deletions

View File

@ -6,12 +6,20 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `cache`.`available_update
`vQuantity` INT
)
BEGIN
/**
* Immediately deduct/add an amount from the available cache (if exists).
*
* @param vItem The item id
* @param vWarehouse The warehouse id
* @param vDated Available cache date
* @param vQuantity The amount to be deducted from the cache
*/
DECLARE vCalc INT;
SELECT id INTO vCalc FROM cache_calc
SELECT id INTO vCalc
FROM cache_calc
WHERE cacheName = 'available'
AND params = CONCAT_WS('/', vWarehouse, vDated)
AND last_refresh <= NOW();
AND params = CONCAT_WS('/', vWarehouse, vDated);
IF vCalc IS NOT NULL THEN
UPDATE available