-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect deadline in Baseline solver (#2040)
# Description Baseline solver iterates through orders from `auction` and executes some logic for each order in a synchronous way. It checks the deadline before each order. It could happen that the new order logic begins to execute 1ms before the deadline and lasts arbitrary amount of time (500ms?) and significantly break the deadline. This code adds a checker if the deadline is reached in the main thread, and if it is, ends the background work prematurely and returns whatever was executed up until that point. ## How to test Example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0e23fa016153883faad8b0e7148b4dfa
- Loading branch information
Showing
1 changed file
with
82 additions
and
63 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