From 7d46ea5149175b033ffb546ad816e22ed5f027fc Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 10 Oct 2023 20:22:11 +0100 Subject: [PATCH] refactor: simplify sleep time functions The `fn_sleep_time` function has been refactored to remove unnecessary conditions and set a default sleep time of 0.5 seconds. Additionally, four new functions (`fn_sleep_time_1`, `fn_sleep_time_5`, `fn_sleep_time_10`) have been added to provide different sleep times of 1, 5, and 10 seconds respectively. This improves code readability and allows for more flexibility in setting sleep times. --- lgsm/modules/core_messages.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh index 5af4c5639a..b472c9ded0 100644 --- a/lgsm/modules/core_messages.sh +++ b/lgsm/modules/core_messages.sh @@ -35,12 +35,19 @@ fn_ansi_loader() { } fn_sleep_time() { - if [ "${sleeptime}" != "0" ] || [ "${travistest}" != "1" ]; then - if [ -z "${sleeptime}" ]; then - sleeptime=0.5 - fi - sleep "${sleeptime}" - fi + sleep "0.1" +} + +fn_sleep_time_1() { + sleep "1" +} + +fn_sleep_time_5() { + sleep "5" +} + +fn_sleep_time_10() { + sleep "10" } # Log display