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
9cb36130
Commit
9cb36130
authored
Jan 22, 2019
by
André Silva
Committed by
asynchronous rob
Jan 22, 2019
Browse files
cli: fix node shutdown (#100)
parent
5893fa7c
Pipeline
#28944
passed with stages
in 12 minutes and 25 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
cli/src/lib.rs
View file @
9cb36130
...
...
@@ -115,8 +115,8 @@ pub fn run<I, T, W>(args: I, worker: W, version: cli::VersionInfo) -> error::Res
let
mut
runtime
=
Runtime
::
new
()
?
;
let
executor
=
runtime
.executor
();
match
config
.roles
==
service
::
Roles
::
LIGHT
{
true
=>
run_until_exit
(
&
mut
runtime
,
Factory
::
new_light
(
config
,
executor
)
?
,
worker
)
?
,
false
=>
run_until_exit
(
&
mut
runtime
,
Factory
::
new_full
(
config
,
executor
)
?
,
worker
)
?
,
true
=>
run_until_exit
(
runtime
,
Factory
::
new_light
(
config
,
executor
)
?
,
worker
)
?
,
false
=>
run_until_exit
(
runtime
,
Factory
::
new_full
(
config
,
executor
)
?
,
worker
)
?
,
}
}
}
...
...
@@ -124,7 +124,7 @@ pub fn run<I, T, W>(args: I, worker: W, version: cli::VersionInfo) -> error::Res
}
fn
run_until_exit
<
T
,
C
,
W
>
(
runtime
:
&
mut
Runtime
,
mut
runtime
:
Runtime
,
service
:
T
,
worker
:
W
,
)
->
error
::
Result
<
()
>
...
...
@@ -141,5 +141,14 @@ fn run_until_exit<T, C, W>(
let
_
=
runtime
.block_on
(
worker
.work
(
&*
service
));
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
();
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