Skip to content

Commit 58a28ce

Browse files
author
Anatoli Kurtsevich
authored
updated exec function logging to provide more info (#130)
1 parent 3318731 commit 58a28ce

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

railib/api.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,13 @@ def exec(
885885
logger.info('exec: database %s engine %s readonly %s' % (database, engine, readonly))
886886
start_time = time.time()
887887
txn = exec_async(ctx, database, engine, command, inputs=inputs, readonly=readonly)
888-
# in case of if short-path, return results directly, no need to poll for
889-
# state
888+
logger.debug('exec: transaction id - %s' % txn.transaction["id"])
889+
890+
# in case of if short-path, return results directly, no need to poll for state
890891
if not (txn.results is None):
891-
logger.info('transaction id: %s' % txn.transaction["id"])
892892
return txn
893893

894+
logger.debug('exec: polling for transaction with id - %s' % txn.transaction["id"])
894895
rsp = TransactionAsyncResponse()
895896
txn = get_transaction(ctx, txn.transaction["id"], **kwargs)
896897

@@ -900,8 +901,6 @@ def exec(
900901
start_time=start_time,
901902
)
902903

903-
logger.info('transaction id: %s' % txn["id"])
904-
905904
rsp.transaction = get_transaction(ctx, txn["id"], **kwargs)
906905
rsp.metadata = get_transaction_metadata(ctx, txn["id"], **kwargs)
907906
rsp.problems = get_transaction_problems(ctx, txn["id"], **kwargs)

0 commit comments

Comments
 (0)