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

Development redisdisconnect #3307

Merged
merged 3 commits into from Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion jumpscale/clients/stellar/stellar.py
Expand Up @@ -6,7 +6,7 @@
from urllib import parse
from urllib.parse import urlparse
from typing import Union

import gevent
import stellar_sdk
from jumpscale.clients.base import Client
from jumpscale.core.base import fields
Expand Down Expand Up @@ -486,6 +486,7 @@ def transfer(
)
except Exception as e:
nretries += 1
gevent.sleep(1)
j.logger.warning(str(e))

raise j.exceptions.Runtime(f"Failed to make transaction for {retries} times, Please try again later")
Expand Down
4 changes: 2 additions & 2 deletions jumpscale/servers/gedis/server.py
Expand Up @@ -277,6 +277,8 @@ def _on_connection(self, socket, address):

except ConnectionError:
j.logger.debug(f"Client {address} closed the connection", address)
parser.on_disconnect()
return

except Exception as exception:
j.logger.exception("internal error", exception=exception)
Expand All @@ -286,7 +288,5 @@ def _on_connection(self, socket, address):
response["success"] = response["error"] is None
encoder.encode(json.dumps(response, default=serialize))

parser.on_disconnect()

except BrokenPipeError:
pass