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

Notify sync is being paused until connection is resumed by ws #230

Conversation

ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Jul 28, 2022

This PR adds the ability to send events by WS to notify users when fetching data from bfx_api_v2 is paused due broken internet connection. Available two WS events:

  • emitENetError when connection is broken, response example:
{
  "jsonrpc": "2.0",
  "result": "DATA_SYNCER",
  "id": null,
  "action": "emitENetError"
}
  • emitENetResumed when connection is resumed, response example:
{
  "jsonrpc": "2.0",
  "result": "DATA_SYNCER",
  "id": null,
  "action": "emitENetResumed"
}

In those two events available the following results, that return caller name:

  • DATA_SYNCER - appears when data syncs from api_v2 to DB
  • CSV_WRITER - appears when CSV file generates from api_v2
  • ACTIVE_POSITIONS_GETTER - appears when UI fetches active positions data from api_v2 for sub-account
  • POSITIONS_AUDIT_GETTER - appears when UI fetches positions audit data from api_v2 for sub-account

Depends on this PR:

Copy link
Contributor

@ezewer ezewer left a comment

Choose a reason for hiding this comment

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

looks good to me!

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.

3 participants