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

mm: light refactoring. more logging #2776

Merged
merged 3 commits into from
Jun 4, 2024
Merged

Conversation

buck54321
Copy link
Member

  • Update architecture such that bots embed unifiedExchangeAdaptor, which reduces duplication and enables sharing of utilities and more concise access to immutable properties.
  • Move pause handling to unifiedExchangeAdaptor
  • Add log formatting utilities
  • More trace logging
  • Normalizes some naming

Copy link
Contributor

@martonp martonp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, definitely cleaner.

Comment on lines +389 to +391
if err := f(); err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the update function fails, this will be in a weird state, because the waitgroup returned from Connect will still not be done. The only way to get the bot to run again is to do another update. You won't be able to start it. I think resuming with the old config would be fine, and if the restart fails, then kill the unifiedExchangeAdaptor.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to just shut the whole thing down if there is an error updating config.

// Process book updates
wg.Add(1)
m.wg.Add(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the bots are using the waitgroup of the exchange adaptor, the Disconnect call in withPause never returns.

dex/asset.go Outdated Show resolved Hide resolved
client/mm/exchange_adaptor.go Outdated Show resolved Hide resolved
@buck54321 buck54321 merged commit 191c61e into decred:master Jun 4, 2024
5 checks passed
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