forked from LBRYCommunity/lbry-sdk
remove queued decorator
This commit is contained in:
parent
5bb08cdf5a
commit
f87d6b08c8
3 changed files with 3 additions and 19 deletions
|
@ -20,6 +20,7 @@ at anytime.
|
|||
* Fixed incorrect response on attempting to delete blob twice
|
||||
* Fixed local node ID reporting in peer list
|
||||
*
|
||||
* Fixed lbryum race condition between combinations of `publish` and `channel_new`
|
||||
|
||||
### Deprecated
|
||||
*
|
||||
|
@ -27,16 +28,14 @@ at anytime.
|
|||
|
||||
### Changed
|
||||
* Moved BLOB_SIZE from conf.py to MAX_BLOB_SIZE in blob/blob_file.py
|
||||
* Use shared deferredSemaphore for api methods decorated with `@AuthJSONRPCServer.queued`
|
||||
|
||||
### Added
|
||||
* Added `utxo_list` command to list unspent transaction outputs
|
||||
* Added redundant API server for currency conversion
|
||||
*
|
||||
|
||||
### Removed
|
||||
* Removed some alternate methods of reading from blob files
|
||||
*
|
||||
* Removed `@AuthJSONRPCServer.queued` decorator
|
||||
|
||||
|
||||
## [0.17.1] - 2017-10-25
|
||||
|
|
|
@ -1701,7 +1701,6 @@ class Daemon(AuthJSONRPCServer):
|
|||
defer.returnValue(cost)
|
||||
|
||||
@AuthJSONRPCServer.auth_required
|
||||
@AuthJSONRPCServer.queued
|
||||
@defer.inlineCallbacks
|
||||
def jsonrpc_channel_new(self, channel_name, amount):
|
||||
"""
|
||||
|
@ -1759,7 +1758,6 @@ class Daemon(AuthJSONRPCServer):
|
|||
defer.returnValue(response)
|
||||
|
||||
@AuthJSONRPCServer.auth_required
|
||||
@AuthJSONRPCServer.queued
|
||||
@defer.inlineCallbacks
|
||||
def jsonrpc_publish(self, name, bid, metadata=None, file_path=None, fee=None, title=None,
|
||||
description=None, author=None, language=None, license=None,
|
||||
|
|
|
@ -116,7 +116,6 @@ class JSONRPCServerType(type):
|
|||
klass.callable_methods = {}
|
||||
klass.deprecated_methods = {}
|
||||
klass.authorized_functions = []
|
||||
klass.queued_methods = []
|
||||
|
||||
for methodname in dir(klass):
|
||||
if methodname.startswith("jsonrpc_"):
|
||||
|
@ -125,8 +124,6 @@ class JSONRPCServerType(type):
|
|||
klass.callable_methods.update({methodname.split("jsonrpc_")[1]: method})
|
||||
if hasattr(method, '_auth_required'):
|
||||
klass.authorized_functions.append(methodname.split("jsonrpc_")[1])
|
||||
if hasattr(method, '_queued'):
|
||||
klass.queued_methods.append(methodname.split("jsonrpc_")[1])
|
||||
else:
|
||||
klass.deprecated_methods.update({methodname.split("jsonrpc_")[1]: method})
|
||||
return klass
|
||||
|
@ -140,11 +137,6 @@ class AuthorizedBase(object):
|
|||
f._auth_required = True
|
||||
return f
|
||||
|
||||
@staticmethod
|
||||
def queued(f):
|
||||
f._queued = True
|
||||
return f
|
||||
|
||||
@staticmethod
|
||||
def deprecated(new_command=None):
|
||||
def _deprecated_wrapper(f):
|
||||
|
@ -196,7 +188,6 @@ class AuthJSONRPCServer(AuthorizedBase):
|
|||
)
|
||||
self.announced_startup = False
|
||||
self.sessions = {}
|
||||
self._queued_lock = defer.DeferredSemaphore(1)
|
||||
|
||||
def setup(self):
|
||||
return NotImplementedError()
|
||||
|
@ -289,7 +280,6 @@ class AuthJSONRPCServer(AuthorizedBase):
|
|||
id_ = None
|
||||
try:
|
||||
function_name = parsed.get('method')
|
||||
is_queued = function_name in self.queued_methods
|
||||
args = parsed.get('params', {})
|
||||
id_ = parsed.get('id', None)
|
||||
token = parsed.pop('hmac', None)
|
||||
|
@ -362,10 +352,7 @@ class AuthJSONRPCServer(AuthorizedBase):
|
|||
)
|
||||
return server.NOT_DONE_YET
|
||||
|
||||
if is_queued:
|
||||
d = self._queued_lock.run(fn, self, **args_dict)
|
||||
else:
|
||||
d = defer.maybeDeferred(fn, self, **args_dict)
|
||||
d = defer.maybeDeferred(fn, self, **args_dict)
|
||||
|
||||
# finished_deferred will callback when the request is finished
|
||||
# and errback if something went wrong. If the errback is
|
||||
|
|
Loading…
Reference in a new issue