Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
py12306
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
python
py12306
Commits
0c817459
Commit
0c817459
authored
Jan 19, 2019
by
Jalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加节点订阅消息丢失重连
parent
05ffcffe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
cluster.py
py12306/cluster/cluster.py
+6
-1
No files found.
py12306/cluster/cluster.py
View file @
0c817459
...
@@ -202,7 +202,12 @@ class Cluster():
...
@@ -202,7 +202,12 @@ class Cluster():
def
subscribe
(
self
):
def
subscribe
(
self
):
while
True
:
while
True
:
try
:
message
=
self
.
pubsub
.
get_message
()
message
=
self
.
pubsub
.
get_message
()
except
RuntimeError
as
err
:
if
'args'
in
dir
(
err
)
and
err
.
args
[
0
]
.
find
(
'pubsub connection not set'
)
>=
0
:
# 失去重连
self
.
pubsub
.
subscribe
(
self
.
KEY_CHANNEL_LOG
,
self
.
KEY_CHANNEL_EVENT
)
continue
if
message
:
if
message
:
if
message
.
get
(
'type'
)
==
'message'
and
message
.
get
(
'channel'
)
==
self
.
KEY_CHANNEL_LOG
and
message
.
get
(
if
message
.
get
(
'type'
)
==
'message'
and
message
.
get
(
'channel'
)
==
self
.
KEY_CHANNEL_LOG
and
message
.
get
(
'data'
):
'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