Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
25c03a69
Commit
25c03a69
authored
Apr 22, 2021
by
Valentin Valls
Browse files
Remove hardcoded references to "data"
parent
ac6b8be4
Changes
1
Hide whitespace changes
Inline
Side-by-side
bliss/data/nodes/scan.py
View file @
25c03a69
...
...
@@ -74,7 +74,7 @@ class ScanNode(DataNodeContainer):
def
get_db_names
(
self
,
**
kw
):
db_names
=
super
().
get_db_names
(
**
kw
)
db_names
.
append
(
self
.
db_name
+
"_data"
)
db_names
.
append
(
self
.
_sync_stream
.
name
)
return
db_names
def
get_settings
(
self
):
...
...
@@ -87,7 +87,8 @@ class ScanNode(DataNodeContainer):
:param DataStreamReader reader:
:param str or int first_index: Redis stream index (None is now)
"""
if
stream_suffix
==
"data"
:
stream_suffix_with_sepator
=
f
"_
{
stream_suffix
}
"
if
self
.
_sync_stream
.
name
.
endswith
(
stream_suffix_with_sepator
):
# Lower priority than all other streams
kw
[
"priority"
]
=
1
super
().
_subscribe_stream
(
stream_suffix
,
reader
,
first_index
=
first_index
,
**
kw
)
...
...
@@ -99,10 +100,20 @@ class ScanNode(DataNodeContainer):
:param **kw: see DataNodeContainer
"""
super
().
_subscribe_streams
(
reader
,
first_index
=
first_index
,
**
kw
)
suffix
=
self
.
_sync_stream
.
name
.
rsplit
(
"_"
,
1
)[
-
1
]
self
.
_subscribe_stream
(
"data"
,
reader
,
first_index
=
0
,
create
=
True
,
ignore_excluded
=
True
suffix
,
reader
,
first_index
=
0
,
create
=
True
,
ignore_excluded
=
True
)
def
get_stream_event_handler
(
self
,
stream
):
"""
:param DataStream stream:
:returns callable:
"""
if
stream
.
name
==
self
.
_sync_stream
.
name
:
return
self
.
_iter_data_stream_events
return
super
(
ScanNode
,
self
).
get_stream_event_handler
(
stream
)
def
_iter_data_stream_events
(
self
,
reader
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment