diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml index 9d4196d..e120680 100644 --- a/.github/workflows/cleanup-cache.yml +++ b/.github/workflows/cleanup-cache.yml @@ -22,7 +22,7 @@ name: Cache Cleanup on: schedule: - - cron: '0 0 * * *' # Daily at midnight UTC + - cron: '30 18 * * *' # Midnight IST (18:30 UTC) workflow_dispatch: {} permissions: diff --git a/backend/CaseConversionAPI/CppLib/include/ProcessStringDLL.hpp b/backend/CaseConversionAPI/CppLib/include/ProcessStringDLL.hpp index 97b2dc8..1456b92 100644 --- a/backend/CaseConversionAPI/CppLib/include/ProcessStringDLL.hpp +++ b/backend/CaseConversionAPI/CppLib/include/ProcessStringDLL.hpp @@ -47,7 +47,7 @@ extern "C" { #endif /** - * @brief COnverts input string based on choice and returns a newly allocated + * @brief Converts input string based on choice and returns a newly allocated * C-string. * * @param input C-string input. diff --git a/backend/CaseConversionAPI/CppLib/src/ProcessStringDLL.cpp b/backend/CaseConversionAPI/CppLib/src/ProcessStringDLL.cpp index d728a3d..0e69ac5 100644 --- a/backend/CaseConversionAPI/CppLib/src/ProcessStringDLL.cpp +++ b/backend/CaseConversionAPI/CppLib/src/ProcessStringDLL.cpp @@ -78,7 +78,8 @@ static const char *safeError(const char *msg) { // Conversion Mapping (Internal - C++ only) //=================================================================== -static bool mapConversionType(ConversionChoice choice, ConversionType &type) { +static bool mapConversionType(ConversionChoice choice, + ConversionType &type) noexcept { switch (choice) { case ConversionChoice::Alternating: type = ConversionType::Alternating; @@ -133,8 +134,9 @@ extern "C" { API const char *processStringDLL(const char *input, int choiceInt, const char *traceId) { try { - if (!input) + if (!input) { return safeError("ERROR_NULL_INPUT"); + } size_t inputLength = std::strlen(input); if (inputLength > MAX_INPUT_SIZE) { @@ -162,14 +164,16 @@ API const char *processStringDLL(const char *input, int choiceInt, ConversionResult result = client.execute(std::string(input)); const char *rawPtr = result.get_c_str(); - if (!rawPtr) + if (!rawPtr) { return safeError("ERROR_ENGINE_RETURNED_NULL"); + } size_t resLen = std::strlen(rawPtr); char *output = static_cast(std::malloc(resLen + 1)); - if (!output) + if (!output) { return safeError("FATAL_ALLOCATION_FAILURE"); + } std::memcpy(output, rawPtr, resLen + 1);