Skip to content

Commit

Permalink
add: edge case for non processed bets
Browse files Browse the repository at this point in the history
  • Loading branch information
keshav1998 committed Nov 29, 2024
1 parent 6e03c80 commit c2999c9
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,19 @@ def _sampled_bet_idx(self, bets: List[Bet]) -> int:
return self.bets.index(bets[0])
else:
# Check if all bets have processed_timestamp == 0
all_bets_not_processed = all(bet.processed_timestamp == 0 for bet in bets)
all_bets_not_processed = all(
bet.processed_timestamp == 0 for bet in bets if bet.queue_no != -1
)

if all_bets_not_processed:
# if none of the bets have been processed, then we should set the current_queue_number to 0
# for all none blacklisted bets
for bet in self.bets:
if bet.queue_no != -1:
bet.queue_no = 0

self.store_bets()

# Current processable list of bets have not been processed yet
# Order the list in Decreasing order of liquidity
bets.sort(
Expand Down

0 comments on commit c2999c9

Please sign in to comment.