Skip to content

Commit dc3540b

Browse files
committed
chore(mu): only allow push to cache if push enabled
1 parent ecbec94 commit dc3540b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

servers/mu/src/domain/api/pushResultToHb.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export function pushResultToHbWith ({
99
buildAndSign,
1010
logger,
1111
HB_GRAPHQL_URL,
12+
ENABLE_PUSH,
1213
fetch
1314
}) {
1415
const getCuAddress = getCuAddressWith({ selectNode, logger })
@@ -38,6 +39,9 @@ export function pushResultToHbWith ({
3839
.chain(getCuAddress)
3940
.chain(pullResult)
4041
.chain((res) => {
42+
if(!ENABLE_PUSH) {
43+
return Rejected(new Error('Repush not enabled on this MU.', { cause: ctx }))
44+
}
4145
const { msgs, number } = res
4246
if (msgs.length <= number) {
4347
return Rejected(new Error('Message number does not exist in the result.', { cause: ctx }))

servers/mu/src/domain/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ export const createApis = async (ctx) => {
418418
buildAndSign: signerClient.buildAndSignWith({ MU_WALLET, logger: pushResultToHbLogger }),
419419
logger: pushResultToHbLogger,
420420
HB_GRAPHQL_URL,
421+
ENABLE_PUSH: ctx.ENABLE_PUSH,
421422
fetch
422423
})
423424

0 commit comments

Comments
 (0)