-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: single shot ask plans #1541
Conversation
This PR changes ask-plan behaviour, now after the order is cancelled, or deal is closed ask plan is removed. This should work better with optimus bot, as it does continous optimization and also simplify code, allowing to make separate scheduling for forward deals
@@ -392,7 +405,7 @@ func (m *Salesman) restoreState() error { | |||
if err := m.resources.Consume(plan); err != nil { | |||
m.log.Warnf("dropping ask plan due to resource changes") | |||
//Ignore error here, as resources that were not consumed can not be released. | |||
m.RemoveAskPlan(plan.ID) | |||
m.RemoveAskPlan(context.TODO(), plan.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WAT?
ask, ok := m.askPlans[planID] | ||
if !ok { | ||
return fmt.Errorf("no such plan %s", planID) | ||
//TODO: rework with error map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
} | ||
|
||
if !plan.GetOrderID().IsZero() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if user will try to remove ask-plan when order is still placing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it will just return error and user can make another try
This PR changes ask-plan behaviour, now after the order is cancelled,
or deal is closed ask plan is removed. This should work better with
optimus bot, as it does continous optimization and also simplify code,
allowing to make separate scheduling for forward deals