comparison sat/plugins/plugin_pubsub_cache.py @ 3863:c04f5e8a3568

plugin pubsub cache: replace empty list by None in `getItemsFromCache`: if an empty list is used, no item can be retrieved, this patch replace empty list by None to avoid this case.
author Goffi <goffi@goffi.org>
date Wed, 20 Jul 2022 17:46:58 +0200
parents 8a2c46122a11
children e345d93fb6e5
comparison
equal deleted inserted replaced
3862:100dd30244c6 3863:c04f5e8a3568
506 if "mam" in extra: 506 if "mam" in extra:
507 raise NotImplementedError("MAM queries are not supported yet") 507 raise NotImplementedError("MAM queries are not supported yet")
508 if max_items is None and rsm_request is None: 508 if max_items is None and rsm_request is None:
509 max_items = 20 509 max_items = 20
510 pubsub_items, metadata = await self.host.memory.storage.getItems( 510 pubsub_items, metadata = await self.host.memory.storage.getItems(
511 node, max_items=max_items, item_ids=item_ids, 511 node, max_items=max_items, item_ids=item_ids or None,
512 order_by=extra.get(C.KEY_ORDER_BY) 512 order_by=extra.get(C.KEY_ORDER_BY)
513 ) 513 )
514 elif max_items is not None: 514 elif max_items is not None:
515 if rsm_request is not None: 515 if rsm_request is not None:
516 raise exceptions.InternalError( 516 raise exceptions.InternalError(