Commit f21dbf76 by Oleksandr Barabash

more logs added

parent f9fb0bc9
...@@ -123,8 +123,8 @@ class CosmosClient: ...@@ -123,8 +123,8 @@ class CosmosClient:
def bl() -> Tuple[List[Dict[str, Any]], str]: def bl() -> Tuple[List[Dict[str, Any]], str]:
""" Potential blocking code """ """ Potential blocking code """
# noinspection SqlDialectInspection,SqlNoDataSourceInspection # noinspection SqlDialectInspection,SqlNoDataSourceInspection
continuation_token = token
items = [] items = []
Log.d(TAG, "get_initiation_items:: init query")
query_iterable = container.query_items( query_iterable = container.query_items(
query="SELECT * FROM r " query="SELECT * FROM r "
"WHERE r.notificationId=@notification_id " "WHERE r.notificationId=@notification_id "
...@@ -135,17 +135,16 @@ class CosmosClient: ...@@ -135,17 +135,16 @@ class CosmosClient:
partition_key=notification_id, partition_key=notification_id,
max_item_count=1 max_item_count=1
) )
Log.d(TAG, "get_initiation_items:: getting pager")
if continuation_token is not None: pager = query_iterable.by_page(token)
pager = query_iterable.by_page(token) Log.d(TAG, "get_initiation_items:: getting page items")
else:
pager = query_iterable.by_page()
current_page = list(pager.next())[0] current_page = list(pager.next())[0]
Log.d(TAG, "get_initiation_items:: appending items")
items.append(current_page) items.append(current_page)
continuation_token = pager.continuation_token Log.d(TAG, "get_initiation_items:: returning Initiations")
return ( return (
Initiation.get_schema(unknown=EXCLUDE).load(items, many=True), Initiation.get_schema(unknown=EXCLUDE).load(items, many=True),
continuation_token pager.continuation_token
) )
return await self.execute_blocking(bl) return await self.execute_blocking(bl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment