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):
|
async def claimtrie_search(self, **kwargs):
|
||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
if isinstance(kwargs, dict):
|
if 'release_time' in kwargs:
|
||||||
kwargs['release_time'] = format_release_time(kwargs.get('release_time'))
|
release_time = kwargs.pop('release_time')
|
||||||
|
try:
|
||||||
|
kwargs['release_time'] = format_release_time(release_time)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
self.session_mgr.pending_query_metric.inc()
|
self.session_mgr.pending_query_metric.inc()
|
||||||
if 'channel' in kwargs:
|
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(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(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(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(claim_type='channel', order_by=['release_time'])))
|
||||||
self.assertEqual(1, len(await self.claim_search(release_time='>=123456', 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