Remove analytics setup code from daemon
Now that lbryid and session_id are available at startup we don't need to reconfigure the analytics manager inside the daemon
This commit is contained in:
parent
8f61fb3fc4
commit
101985ca11
2 changed files with 5 additions and 16 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import base58
|
||||||
|
|
||||||
from lbrynet.core import looping_call_manager
|
from lbrynet.core import looping_call_manager
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
@ -26,8 +28,9 @@ class Manager(object):
|
||||||
api = Api.new_instance()
|
api = Api.new_instance()
|
||||||
if events is None:
|
if events is None:
|
||||||
events = Events(
|
events = Events(
|
||||||
make_context(get_platform(), settings.wallet),
|
make_context(get_platform(), conf.settings.wallet),
|
||||||
'not loaded', 'not loaded'
|
base58.b58encode(conf.settings.lbryid),
|
||||||
|
conf.settings.session_id,
|
||||||
)
|
)
|
||||||
return cls(api, events, Track())
|
return cls(api, events, Track())
|
||||||
|
|
||||||
|
|
|
@ -376,10 +376,6 @@ class Daemon(AuthJSONRPCServer):
|
||||||
self.lbryid = utils.generate_id()
|
self.lbryid = utils.generate_id()
|
||||||
lbryid_file.write(base58.b58encode(self.lbryid))
|
lbryid_file.write(base58.b58encode(self.lbryid))
|
||||||
|
|
||||||
def _set_events(self):
|
|
||||||
context = analytics.make_context(self._get_platform(), self.wallet_type)
|
|
||||||
self._events = analytics.Events(context, base58.b58encode(self.lbryid), self._session_id)
|
|
||||||
|
|
||||||
def _check_network_connection(self):
|
def _check_network_connection(self):
|
||||||
self.connected_to_internet = utils.check_connection()
|
self.connected_to_internet = utils.check_connection()
|
||||||
|
|
||||||
|
@ -694,16 +690,6 @@ class Daemon(AuthJSONRPCServer):
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def _get_analytics(self):
|
def _get_analytics(self):
|
||||||
context = analytics.make_context(self._get_platform(), self.wallet_type)
|
|
||||||
events_generator = analytics.Events(
|
|
||||||
context, base58.b58encode(self.lbryid), self._session_id)
|
|
||||||
if self.analytics_manager is None:
|
|
||||||
self.analytics_manager = analytics.Manager.new_instance(
|
|
||||||
events=events_generator
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
self.analytics_manager.update_events_generator(events_generator)
|
|
||||||
|
|
||||||
if not self.analytics_manager.is_started:
|
if not self.analytics_manager.is_started:
|
||||||
self.analytics_manager.start()
|
self.analytics_manager.start()
|
||||||
self.analytics_manager.register_repeating_metric(
|
self.analytics_manager.register_repeating_metric(
|
||||||
|
|
Loading…
Reference in a new issue