From: ThomasV Date: Wed, 13 Jun 2012 14:30:55 +0000 (+0400) Subject: adding server.load command X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=b4c5585a3e1ded3a9974cb8d00f9556ee0f1906a adding server.load command --- diff --git a/backends/irc/__init__.py b/backends/irc/__init__.py index 87b6fa0..edd9dc9 100644 --- a/backends/irc/__init__.py +++ b/backends/irc/__init__.py @@ -143,6 +143,10 @@ class ServerProcessor(Processor): "subscriptions":len(s.subscriptions)}, self.dispatcher.request_dispatcher.get_sessions()) + elif method == 'server.load': + p = self.dispatcher.request_dispatcher.processors['blockchain'] + result = p.queue.qsize() + else: print "unknown method", request diff --git a/server.py b/server.py index 1111521..c636c0c 100755 --- a/server.py +++ b/server.py @@ -70,8 +70,8 @@ def run_rpc_command(command, stratum_tcp_port): if msg.find('\n') != -1: break s.close() r = json.loads(msg).get('result') - if command == 'stop': print r - elif command == 'info': + + if command == 'info': now = time.time() print 'type address sub version time' for item in r: @@ -80,6 +80,8 @@ def run_rpc_command(command, stratum_tcp_port): item.get('subscriptions'), item.get('version'), (now - item.get('time')) ) + else: + print r if __name__ == '__main__': config = create_config()