forked from LBRYCommunity/lbry-sdk
handle invalid release time
This commit is contained in:
parent
3970e91766
commit
a0e0039988
2 changed files with 7 additions and 2 deletions
|
@ -979,8 +979,12 @@ class LBRYElectrumX(SessionBase):
|
|||
|
||||
async def claimtrie_search(self, **kwargs):
|
||||
start = time.perf_counter()
|
||||
if isinstance(kwargs, dict):
|
||||
kwargs['release_time'] = format_release_time(kwargs.get('release_time'))
|
||||
if 'release_time' in kwargs:
|
||||
release_time = kwargs.pop('release_time')
|
||||
try:
|
||||
kwargs['release_time'] = format_release_time(release_time)
|
||||
except ValueError:
|
||||
pass
|
||||
try:
|
||||
self.session_mgr.pending_query_metric.inc()
|
||||
if 'channel' in kwargs:
|
||||
|
|
|
@ -1767,6 +1767,7 @@ class StreamCommands(ClaimTestCase):
|
|||
self.assertEqual(3, len(await self.claim_search(release_time='>0', order_by=['release_time'])))
|
||||
self.assertEqual(3, len(await self.claim_search(release_time='>=0', order_by=['release_time'])))
|
||||
self.assertEqual(4, len(await self.claim_search(order_by=['release_time'])))
|
||||
self.assertEqual(4, len(await self.claim_search(release_time='<derp', order_by=['release_time'])))
|
||||
self.assertEqual(3, len(await self.claim_search(claim_type='stream', order_by=['release_time'])))
|
||||
self.assertEqual(1, len(await self.claim_search(claim_type='channel', order_by=['release_time'])))
|
||||
self.assertEqual(1, len(await self.claim_search(release_time='>=123456', order_by=['release_time'])))
|
||||
|
|
Loading…
Reference in a new issue