Skip to content

Commit

Permalink
Fix typo in wait until available parsing. (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnwpark authored Feb 12, 2025
1 parent 91ce762 commit 4bbf2b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Gel.Net.Driver/Utils/ConfigUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ internal static ResolvedFields FromCredentials(ConnectionCredentials credentials
private static readonly Regex _humanMilliseconds = new Regex(
@"(?<time>(?:(?<=\s|^)-\s*)?\d*\.?\d*)\s*(?:ms(?=\s|\d|\.|$)|milliseconds?(?:\s|$))",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex _humanNanoseconds = new Regex(
private static readonly Regex _humanMicroseconds = new Regex(
@"(?<time>(?:(?<=\s|^)-\s*)?\d*\.?\d*)\s*(?:us(\s|\d|\.|$)|microseconds?(?:\s|$))",
RegexOptions.Compiled | RegexOptions.IgnoreCase);

Expand Down Expand Up @@ -468,8 +468,8 @@ static bool PopHumanDuration(Regex regex, int factor, ref string text, ref int t
if (PopHumanDuration(_humanMinutes, 60 * 1000, ref text, ref time)) { found = true; }
if (PopHumanDuration(_humanSeconds, 1 * 1000, ref text, ref time)) { found = true; }
if (PopHumanDuration(_humanMilliseconds, 1, ref text, ref time)) { found = true; }
// We parse nanoseconds, but don't support them
if (PopHumanDuration(_humanNanoseconds, 0, ref text, ref time)) { found = true; }
// We parse microseconds, but don't support them
if (PopHumanDuration(_humanMicroseconds, 0, ref text, ref time)) { found = true; }
if (found && text.Trim() == "")
{
return time;
Expand Down

0 comments on commit 4bbf2b4

Please sign in to comment.