zqr10159 opened a new pull request, #3924:
URL: https://github.com/apache/hertzbeat/pull/3924

   This pull request enhances the handling of expiration time formats in the 
`DuckdbDatabaseDataStorage` class, making the parsing of day-based durations 
more robust and user-friendly. The changes introduce a regular expression to 
strictly match day formats (like "90d" or "7D") and improve input sanitization 
before parsing.
   
   Improvements to expiration time parsing:
   
   * Added a `DAY_PATTERN` regex to strictly match and capture day-based 
expiration strings, such as "90d" or "7D", improving clarity and preventing 
ambiguous parsing.
   * Updated the expiration time parsing logic in `startExpiredDataCleaner()` 
to:
     - Trim whitespace from the input string.
     - Use the new regex to detect and handle day-based formats explicitly.
     - Fall back to existing utilities for other time units (hours, minutes, 
seconds), ensuring backward compatibility.
   
   General code enhancements:
   
   * Imported `java.util.regex.Matcher` and `java.util.regex.Pattern` to 
support the new regex-based parsing logic.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to