Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
0122a5e8
Commit
0122a5e8
authored
Feb 20, 2024
by
Jonathan Becker
Committed by
oroulet
Feb 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve ha client keepalive error handling
parent
f1f961f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
22 deletions
+29
-22
asyncua/client/ha/ha_client.py
asyncua/client/ha/ha_client.py
+29
-22
No files found.
asyncua/client/ha/ha_client.py
View file @
0122a5e8
...
@@ -450,6 +450,10 @@ class KeepAlive:
...
@@ -450,6 +450,10 @@ class KeepAlive:
f"Starting keepalive loop for
{
server_info
.
url
}
, checking every
{
self
.
timer
}
sec"
f"Starting keepalive loop for
{
server_info
.
url
}
, checking every
{
self
.
timer
}
sec"
)
)
while
self
.
is_running
:
while
self
.
is_running
:
if
client
.
uaclient
.
protocol
is
None
:
server_info
.
status
=
ConnectionStates
.
NO_DATA
_logger
.
info
(
"No active client"
)
else
:
try
:
try
:
status
,
slevel
=
await
client
.
read_values
([
status_node
,
slevel_node
])
status
,
slevel
=
await
client
.
read_values
([
status_node
,
slevel_node
])
if
status
!=
ua
.
ServerState
.
Running
:
if
status
!=
ua
.
ServerState
.
Running
:
...
@@ -460,9 +464,12 @@ class KeepAlive:
...
@@ -460,9 +464,12 @@ class KeepAlive:
except
BadSessionNotActivated
:
except
BadSessionNotActivated
:
_logger
.
warning
(
"Session is not yet activated."
)
_logger
.
warning
(
"Session is not yet activated."
)
server_info
.
status
=
ConnectionStates
.
NO_DATA
server_info
.
status
=
ConnectionStates
.
NO_DATA
except
BadSessionClosed
:
except
BadSessionClosed
:
_logger
.
warning
(
"Session is closed."
)
_logger
.
warning
(
"Session is closed."
)
server_info
.
status
=
ConnectionStates
.
NO_DATA
server_info
.
status
=
ConnectionStates
.
NO_DATA
except
ConnectionError
:
_logger
.
warning
(
"No connection."
)
server_info
.
status
=
ConnectionStates
.
NO_DATA
except
asyncio
.
TimeoutError
:
except
asyncio
.
TimeoutError
:
_logger
.
warning
(
"Timeout when fetching state"
)
_logger
.
warning
(
"Timeout when fetching state"
)
server_info
.
status
=
ConnectionStates
.
NO_DATA
server_info
.
status
=
ConnectionStates
.
NO_DATA
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment