Skip to content

Commit

Permalink
Lower skipFinder function threshold level
Browse files Browse the repository at this point in the history
Lowered the threshold level checked by the 'skipFinder' function in 'pool.go' from 6 to 4, and in 'delay_manager_v2.go' from 5.0 to 3.0. This will result in eliminations in the pool and rate limit being more aggressive, thereby reducing resource usage and potentially increasing efficiency.
  • Loading branch information
lueurxax committed Dec 23, 2023
1 parent 1db380f commit 7009d4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/tweetfinder/delay_manager_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (m *managerV2) TooManyRequests(ctx context.Context) {

settled := false

level := 5.0
level := 3.0

for !settled {
for _, limiter := range m.windowLimiters {
Expand Down
2 changes: 1 addition & 1 deletion internal/tweetfinder/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (p *pool) getFinderIndex(ctx context.Context) (int, bool) {
}

func skipFinder(d float64) bool {
return d == 0 || d > 6
return d == 0 || d > 4
}

func (p *pool) releaseFinder(i int) {
Expand Down

0 comments on commit 7009d4a

Please sign in to comment.