-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[patch] ✨ Add egress filter retrying feature
Signed-off-by: Rintaro Okamura <[email protected]>
- Loading branch information
Showing
4 changed files
with
93 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- if `retry.Enabled` is true, retry ANN search when the number of `results` is lower than the required number. | ||
retry.Enabled = true | ||
-- `retry.MaxRetries` represents maximum number of retries. | ||
retry.MaxRetries = 3 | ||
-- `retry.NextNumMultiplier` represents how to increase number of internal search results. | ||
retry.NextNumMultiplier = 2 | ||
|
||
local remains = {} | ||
for i, r in results() do | ||
-- remove elements if ID lengths is lower than 3 | ||
if string.len(r.Id) >= 3 then | ||
remains[#remains+1] = r | ||
end | ||
|
||
results[i] = nil | ||
end | ||
|
||
for i, r in pairs(remains) do | ||
results[i] = r | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters