Merge branch 'dev' into 8612-shelvinge2e
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
PAU ROVIRA ROSALENY 2025-02-21 10:58:14 +00:00
commit 5d964c4e52
6 changed files with 9 additions and 47 deletions

View File

@ -1,5 +1,5 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION util.mockTime()
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION util.mockTime()
RETURNS DATETIME
DETERMINISTIC
BEGIN
@ -8,7 +8,7 @@ END$$
DELIMITER ;
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION util.mockUtcTime()
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION util.mockUtcTime()
RETURNS DATETIME
DETERMINISTIC
BEGIN

View File

@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `util`.`mockTime`()
BEGIN
/**
* Returns current dateTime
*
*
* @return current datetime
*/
RETURN NOW();

View File

@ -1,26 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `util`.`mockTimeBase`(vIsUtc BOOL)
RETURNS datetime
DETERMINISTIC
BEGIN
/**
* Returns the date formatted to utc if vIsUtc or config.mocTz if not
*
* @param vIsUtc If date must be returned as UTC format
* @return The formatted mock time
*/
DECLARE vMockUtcTime DATETIME;
DECLARE vMockTz VARCHAR(255);
SELECT mockUtcTime, mockTz
INTO vMockUtcTime, vMockTz
FROM config
LIMIT 1;
IF vIsUtc OR vMockTz IS NULL THEN
RETURN vMockUtcTime;
ELSE
RETURN CONVERT_TZ(vMockUtcTime, '+00:00', vMockTz);
END IF;
END$$
DELIMITER ;

View File

@ -4,22 +4,10 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `util`.`mockUtcTime`()
DETERMINISTIC
BEGIN
/**
* Returns the UTC datetime in mockTime format or timeStamp depending on config table
* Returns current UTC dateTime
*
* @return The UTC datetime format
*/
-- FIXME: #5041 Commented because there is slowness when querying a table
/*
DECLARE vMockEnabled BOOL;
SELECT mockEnabled INTO vMockEnabled FROM config LIMIT 1;
IF vMockEnabled THEN
RETURN mockTimeBase(TRUE);
ELSE
RETURN UTC_TIMESTAMP();
END IF;
*/
RETURN UTC_TIMESTAMP();
END$$
DELIMITER ;

View File

@ -60,7 +60,7 @@
"@babel/register": "^7.7.7",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@verdnatura/myt": "^1.6.12",
"@verdnatura/myt": "^1.6.13",
"angular-mocks": "^1.7.9",
"babel-jest": "^26.0.1",
"babel-loader": "^8.2.4",

View File

@ -143,8 +143,8 @@ devDependencies:
specifier: ^19.1.0
version: 19.1.0
'@verdnatura/myt':
specifier: ^1.6.12
version: 1.6.12
specifier: ^1.6.13
version: 1.6.13
angular-mocks:
specifier: ^1.7.9
version: 1.8.3
@ -2846,8 +2846,8 @@ packages:
dev: false
optional: true
/@verdnatura/myt@1.6.12:
resolution: {integrity: sha512-t/SiDuQW9KJkcjhwQ9AkrcoTwghxQ7IyQ56e+88eYdoMi24l6bQGF0wHzMaIPRfQAoR8hqgfMOief4OAqW4Iqw==}
/@verdnatura/myt@1.6.13:
resolution: {integrity: sha512-Qw5cfXa2FnjrMBbzP3InYc3vIjbNhyHhmle12Y7FaYFeYE+CXlerryuMqtcoe4+9PsCqwDCKlW37YKmipy2cnQ==}
hasBin: true
dependencies:
'@sqltools/formatter': 1.2.5