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

Fix session handling #37

Merged
merged 1 commit into from
Feb 3, 2024
Merged

Fix session handling #37

merged 1 commit into from
Feb 3, 2024

Conversation

rlywtf
Copy link

@rlywtf rlywtf commented Feb 3, 2024

We need to handle session disconnects, resuming, and changes in shard states.

This fixes some of the errors we were seeing with:

  • Shard ID None WebSocket closed
  • Shard ID None heartbeat blocked for more than

This also makes a new call_openai_api function definition and turns the response into an async call on a thread.

The rate limit function was cleaned up while I was here.

The Flake8 complexity was reduced to its default of 10 and the main function has this check disabled now.

@rlywtf rlywtf force-pushed the fix_session_handling branch from fcd8492 to 9bca4ca Compare February 3, 2024 03:12
We need to handle session disconnects, resuming, and changes in
shard states.

This fixes some of the errors we were seeing with:
 - Shard ID None WebSocket closed
 - Shard ID None heartbeat blocked for more than

This also makes a new `call_openai_api` function definition and
turns the response into an async call on a thread.

The rate limit function was cleaned up while I was here.

The Flake8 complexity was reduced to its default of 10 and the main
function has this check disabled now.
@rlywtf rlywtf force-pushed the fix_session_handling branch from 9bca4ca to c86a6d0 Compare February 3, 2024 03:15
@rlywtf rlywtf merged commit 4707660 into main Feb 3, 2024
3 checks passed
@rlywtf rlywtf deleted the fix_session_handling branch February 3, 2024 03:17
johndotpub added a commit that referenced this pull request Feb 19, 2024
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.

2 participants