forked from LBRYCommunity/lbry-sdk
fixed shutdown messages
This commit is contained in:
parent
f916a4a82d
commit
02d4444780
9 changed files with 15 additions and 14 deletions
|
@ -233,7 +233,7 @@ class Api(object):
|
|||
def track(self, event):
|
||||
"""Send a single tracking event"""
|
||||
if not self._enabled:
|
||||
return defer.succeed('analytics disabled')
|
||||
return defer.succeed('Analytics disabled')
|
||||
|
||||
def _log_error(failure, event):
|
||||
log.warning('Failed to send track event. %s (%s)', failure.getTraceback(), str(event))
|
||||
|
|
|
@ -27,12 +27,12 @@ class BlobAvailabilityTracker(object):
|
|||
self._check_mine = LoopingCall(self._update_mine)
|
||||
|
||||
def start(self):
|
||||
log.info("Starting %s", self)
|
||||
log.info("Starting blob availability tracker.")
|
||||
self._check_popular.start(600)
|
||||
self._check_mine.start(600)
|
||||
|
||||
def stop(self):
|
||||
log.info("Stopping %s", self)
|
||||
log.info("Stopping blob availability tracker.")
|
||||
if self._check_popular.running:
|
||||
self._check_popular.stop()
|
||||
if self._check_mine.running:
|
||||
|
|
|
@ -28,12 +28,12 @@ class DiskBlobManager(DHTHashSupplier):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def setup(self):
|
||||
log.info("Setting up the DiskBlobManager. blob_dir: %s, db_file: %s", str(self.blob_dir),
|
||||
log.info("Starting disk blob manager. blob_dir: %s, db_file: %s", str(self.blob_dir),
|
||||
str(self.db_file))
|
||||
yield self._open_db()
|
||||
|
||||
def stop(self):
|
||||
log.info("Stopping the DiskBlobManager")
|
||||
log.info("Stopping disk blob manager.")
|
||||
self.db_conn.close()
|
||||
return defer.succeed(True)
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class RateLimiter(object):
|
|||
self.protocols = []
|
||||
|
||||
def start(self):
|
||||
log.info("Starting %s", self)
|
||||
log.info("Starting rate limiter.")
|
||||
self.tick_call = task.LoopingCall(self.tick)
|
||||
self.tick_call.start(self.tick_interval)
|
||||
|
||||
|
@ -80,7 +80,7 @@ class RateLimiter(object):
|
|||
self.unthrottle_ul()
|
||||
|
||||
def stop(self):
|
||||
log.info("Stopping %s", self)
|
||||
log.info("Stopping rate limiter.")
|
||||
if self.tick_call is not None:
|
||||
self.tick_call.stop()
|
||||
self.tick_call = None
|
||||
|
|
|
@ -140,7 +140,7 @@ class Session(object):
|
|||
def setup(self):
|
||||
"""Create the blob directory and database if necessary, start all desired services"""
|
||||
|
||||
log.debug("Setting up the lbry session")
|
||||
log.debug("Starting session.")
|
||||
|
||||
if self.lbryid is None:
|
||||
self.lbryid = generate_id()
|
||||
|
@ -169,7 +169,7 @@ class Session(object):
|
|||
|
||||
def shut_down(self):
|
||||
"""Stop all services"""
|
||||
log.info('Shutting down %s', self)
|
||||
log.info('Stopping session.')
|
||||
ds = []
|
||||
if self.blob_tracker is not None:
|
||||
ds.append(defer.maybeDeferred(self.blob_tracker.stop))
|
||||
|
@ -320,7 +320,7 @@ class Session(object):
|
|||
return dl
|
||||
|
||||
def _unset_upnp(self):
|
||||
log.info("Unsetting upnp for %s", self)
|
||||
log.info("Unsetting upnp for session")
|
||||
|
||||
def threaded_unset_upnp():
|
||||
u = miniupnpc.UPnP()
|
||||
|
|
|
@ -448,6 +448,7 @@ class Wallet(object):
|
|||
self._batch_count = 20
|
||||
|
||||
def start(self):
|
||||
log.info("Starting wallet.")
|
||||
def start_manage():
|
||||
self.stopped = False
|
||||
self.manage()
|
||||
|
@ -472,7 +473,7 @@ class Wallet(object):
|
|||
log.error("An error occurred stopping the wallet: %s", err.getTraceback())
|
||||
|
||||
def stop(self):
|
||||
log.info("Stopping %s", self)
|
||||
log.info("Stopping wallet.")
|
||||
self.stopped = True
|
||||
# If self.next_manage_call is None, then manage is currently running or else
|
||||
# start has not been called, so set stopped and do nothing else.
|
||||
|
|
|
@ -25,7 +25,7 @@ class DHTPeerFinder(object):
|
|||
self.next_manage_call = reactor.callLater(60, self.run_manage_loop)
|
||||
|
||||
def stop(self):
|
||||
log.info("Stopping %s", self)
|
||||
log.info("Stopping DHT peer finder.")
|
||||
if self.next_manage_call is not None and self.next_manage_call.active():
|
||||
self.next_manage_call.cancel()
|
||||
self.next_manage_call = None
|
||||
|
|
|
@ -28,7 +28,7 @@ class DHTHashAnnouncer(object):
|
|||
self.next_manage_call = utils.call_later(self.ANNOUNCE_CHECK_INTERVAL, self.run_manage_loop)
|
||||
|
||||
def stop(self):
|
||||
log.info("Stopping %s", self)
|
||||
log.info("Stopping DHT hash announcer.")
|
||||
if self.next_manage_call is not None:
|
||||
self.next_manage_call.cancel()
|
||||
self.next_manage_call = None
|
||||
|
|
|
@ -346,7 +346,7 @@ class Daemon(AuthJSONRPCServer):
|
|||
try:
|
||||
if self.lbry_server_port is not None:
|
||||
self.lbry_server_port, old_port = None, self.lbry_server_port
|
||||
log.info('Stop listening to %s', old_port)
|
||||
log.info('Stop listening on port %s', old_port.port)
|
||||
return defer.maybeDeferred(old_port.stopListening)
|
||||
else:
|
||||
return defer.succeed(True)
|
||||
|
|
Loading…
Reference in a new issue