Skip to content

Commit 7417cff

Browse files
committed
@GitHK review: doc and rm comments
1 parent dee7ebb commit 7417cff

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

services/payments/src/simcore_service_payments/services/payments.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ async def on_payment_completed(
155155
if notify_enabled:
156156
_logger.debug(
157157
"Notify front-end of payment -> sio SOCKET_IO_PAYMENT_COMPLETED_EVENT "
158-
"socketio.notify_payment_completed(sio, user_primary_group_id=gid, payment=transaction)"
159158
)
160159

161160
if transaction.state == PaymentTransactionState.SUCCESS:

services/web/server/src/simcore_service_webserver/wallets/_payments_handlers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ async def _delete_payment_method(request: web.Request):
300300
return web.HTTPNoContent(content_type=MIMETYPE_APPLICATION_JSON)
301301

302302

303+
_TINY_WAIT_TO_TRIGGER_CONTEXT_SWITCH = 0.1
304+
305+
303306
@routes.post(
304307
f"/{VTAG}/wallets/{{wallet_id}}/payments-methods/{{payment_method_id}}:pay",
305308
name="pay_with_payment_method",
@@ -344,8 +347,8 @@ async def _pay_with_payment_method(request: web.Request):
344347
# instead we emulate a init-prompt-ack workflow by firing a background task that acks payment
345348

346349
async def _notify_payment_completed_after_response(app, user_id, payment):
347-
# A small delay to send notification just after the response
348-
await asyncio.sleep(0.1)
350+
# NOTE: A small delay to send notification just after the response
351+
await asyncio.sleep(_TINY_WAIT_TO_TRIGGER_CONTEXT_SWITCH)
349352
return (
350353
await notify_payment_completed(app, user_id=user_id, payment=payment),
351354
)

0 commit comments

Comments
 (0)