Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ddorgan
polkadot
Commits
eb6a2ec3
Unverified
Commit
eb6a2ec3
authored
Jun 22, 2018
by
Gav Wood
Committed by
GitHub
Jun 22, 2018
Browse files
Fix telemetry (#231)
* Fix telemetry * Correct default telemetry * Extra logging
parent
ddcb0ddf
Changes
2
Hide whitespace changes
Inline
Side-by-side
polkadot/cli/src/lib.rs
View file @
eb6a2ec3
...
...
@@ -84,7 +84,7 @@ use futures::sync::mpsc;
use
futures
::{
Sink
,
Future
,
Stream
};
use
tokio_core
::
reactor
;
const
DEFAULT_TELEMETRY_URL
:
&
str
=
"ws
s
://telemetry.polkadot.io:
443
"
;
const
DEFAULT_TELEMETRY_URL
:
&
str
=
"ws://telemetry.polkadot.io:
1024
"
;
#[derive(Clone)]
struct
SystemConfiguration
{
...
...
substrate/telemetry/src/lib.rs
View file @
eb6a2ec3
...
...
@@ -25,6 +25,8 @@ extern crate parking_lot;
extern
crate
websocket
as
ws
;
extern
crate
slog_async
;
extern
crate
slog_json
;
#[macro_use]
extern
crate
log
;
#[macro_use(o,
kv)]
extern
crate
slog
;
extern
crate
slog_scope
;
...
...
@@ -77,6 +79,7 @@ struct TelemetryWriter {
impl
TelemetryWriter
{
fn
ensure_connected
(
&
mut
self
)
{
if
self
.first_time
{
info!
(
"Connected to telemetry server: {}"
,
self
.config.url
);
(
self
.config.on_connect
)();
self
.first_time
=
false
;
}
...
...
@@ -105,7 +108,7 @@ impl io::Write for TelemetryWriter {
let
mut
l
=
self
.out
.lock
();
let
socket_closed
=
if
let
Some
(
ref
mut
socket
)
=
*
l
{
if
let
Ok
(
s
)
=
::
std
::
str
::
from_utf8
(
&
self
.buffer
[
..
])
{
socket
.send_message
(
&
ws
::
Message
::
text
(
s
))
.is_
ok
()
socket
.send_message
(
&
ws
::
Message
::
text
(
s
))
.is_
err
()
}
else
{
false
}
}
else
{
false
};
if
socket_closed
{
...
...
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