Skip to content
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

Merged
merged 7 commits into from
Oct 4, 2018
Merged

refactor: single shot ask plans #1541

merged 7 commits into from
Oct 4, 2018

Conversation

antmat
Copy link
Collaborator

@antmat antmat commented Sep 24, 2018

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

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)
Copy link
Member

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
Copy link
Member

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() {
Copy link
Member

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?

Copy link
Collaborator Author

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

@nikonov1101 nikonov1101 added this to the v0.4.13 milestone Oct 2, 2018
@antmat antmat mentioned this pull request Oct 3, 2018
@3Hren 3Hren merged commit efb4d1d into master Oct 4, 2018
@3Hren 3Hren deleted the refact/single_shot_ask_plans branch October 4, 2018 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants