Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
414499ec
Unverified
Commit
414499ec
authored
Jul 10, 2019
by
Bastian Köcher
Committed by
GitHub
Jul 10, 2019
Browse files
Poll the service to drive the whole node (#321)
parent
099f741c
Pipeline
#42937
passed with stages
in 15 minutes
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cli/src/lib.rs
View file @
414499ec
...
...
@@ -112,7 +112,7 @@ fn run_until_exit<T, C, W>(
worker
:
W
,
)
->
error
::
Result
<
()
>
where
T
:
Deref
<
Target
=
BareService
<
C
>>
,
T
:
Deref
<
Target
=
BareService
<
C
>>
+
Future
<
Item
=
(),
Error
=
()
>
+
Send
+
'static
,
C
:
service
::
Components
,
BareService
<
C
>
:
PolkadotService
,
W
:
Worker
,
...
...
@@ -123,16 +123,13 @@ fn run_until_exit<T, C, W>(
let
informant
=
cli
::
informant
::
build
(
&
service
);
executor
.spawn
(
exit
.until
(
informant
)
.map
(|
_
|
()));
let
_
=
runtime
.block_on
(
worker
.work
(
&*
service
,
Arc
::
new
(
executor
)));
exit_send
.fire
();
// we eagerly drop the service so that the internal exit future is fired,
// but we need to keep holding a reference to the global telemetry guard
let
_telemetry
=
service
.telemetry
();
drop
(
service
);
// TODO [andre]: timeout this future (https://github.com/paritytech/substrate/issues/1318)
let
_
=
runtime
.shutdown_on_idle
()
.wait
();
let
work
=
worker
.work
(
&*
service
,
Arc
::
new
(
executor
));
let
_
=
runtime
.block_on
(
service
.select
(
work
));
exit_send
.fire
();
Ok
(())
}
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