Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
209bc661
Commit
209bc661
authored
5 years ago
by
Holger
Browse files
Options
Downloads
Patches
Plain Diff
Add disable node function
parent
d0357be5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
beemapi/node.py
+5
-0
5 additions, 0 deletions
beemapi/node.py
beemapi/steemnoderpc.py
+4
-2
4 additions, 2 deletions
beemapi/steemnoderpc.py
with
9 additions
and
2 deletions
beemapi/node.py
+
5
−
0
View file @
209bc661
...
...
@@ -120,6 +120,11 @@ class Nodes(list):
def
num_retries_call_reached
(
self
):
return
self
.
error_cnt_call
>=
self
.
num_retries_call
def
disable_node
(
self
):
"""
Disable current node
"""
if
self
.
node
is
not
None
and
self
.
num_retries_call
>=
0
:
self
.
node
.
error_cnt_call
=
self
.
num_retries_call
def
increase_error_cnt
(
self
):
"""
Increase node error count for current node
"""
if
self
.
node
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
beemapi/steemnoderpc.py
+
4
−
2
View file @
209bc661
...
...
@@ -118,8 +118,9 @@ class SteemNodeRPC(GrapheneRPC):
elif
re
.
search
(
"
Could not find API
"
,
msg
):
if
self
.
_check_api_name
(
msg
):
if
self
.
nodes
.
working_nodes_count
>
1
and
self
.
nodes
.
num_retries
>
-
1
:
self
.
nodes
.
disable_node
()
self
.
_switch_to_next_node
(
msg
,
"
ApiNotSupported
"
)
doRetry
=
Fals
e
doRetry
=
Tru
e
else
:
raise
exceptions
.
ApiNotSupported
(
msg
)
else
:
...
...
@@ -151,8 +152,9 @@ class SteemNodeRPC(GrapheneRPC):
raise
exceptions
.
UnhandledRPCError
(
"
Use Operation(op, appbase=True) to prevent error:
"
+
msg
)
elif
re
.
search
(
"
Client returned invalid format. Expected JSON!
"
,
msg
):
if
self
.
nodes
.
working_nodes_count
>
1
and
self
.
nodes
.
num_retries
>
-
1
:
self
.
nodes
.
disable_node
()
self
.
_switch_to_next_node
(
msg
)
doRetry
=
Fals
e
doRetry
=
Tru
e
else
:
raise
exceptions
.
UnhandledRPCError
(
msg
)
elif
msg
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment