File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,12 @@ JsRpcPromiseAndPipleine callImpl(
467
467
468
468
auto & ioContext = IoContext::current ();
469
469
470
+ KJ_IF_SOME (lock, ioContext.waitForOutputLocksIfNecessary ()) {
471
+ // Replace the client with a promise client that will delay thecall until the output gate
472
+ // is open.
473
+ client = lock.then ([client = kj::mv (client)]() mutable { return kj::mv (client); });
474
+ }
475
+
470
476
auto builder = client.callRequest ();
471
477
472
478
// This code here is slightly overcomplicated in order to avoid pushing anything to the
@@ -1052,7 +1058,13 @@ public:
1052
1058
js.throwException (kj::mv (error));
1053
1059
})));
1054
1060
1055
- return result;
1061
+ if (ctx.hasOutputGate ()) {
1062
+ return result.then ([this ]() {
1063
+ return KJ_REQUIRE_NONNULL (weakIoContext->tryGet ()).waitForOutputLocks ();
1064
+ });
1065
+ } else {
1066
+ return result;
1067
+ }
1056
1068
};
1057
1069
1058
1070
switch (op.which ()) {
You can’t perform that action at this time.
0 commit comments