less chatter, pub check
This commit is contained in:
parent
d4cc93d39b
commit
9f31d8ef9c
2 changed files with 19 additions and 6 deletions
|
|
@ -120,8 +120,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => {
|
||||||
|
|
||||||
if (shouldRetry(resolvedValue)) {
|
if (shouldRetry(resolvedValue)) {
|
||||||
logger.info(
|
logger.info(
|
||||||
'force retrying' +
|
'force retrying' /* +
|
||||||
` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}`
|
` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}`
|
||||||
|
*/
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return resolvedValue
|
return resolvedValue
|
||||||
|
|
@ -135,8 +136,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`\n retrying \n` +
|
`\n retrying \n` /* +
|
||||||
` args: ${promGen.toString()} -- ${shouldRetry.toString()}`
|
` args: ${promGen.toString()} -- ${shouldRetry.toString()}`
|
||||||
|
*/
|
||||||
)
|
)
|
||||||
|
|
||||||
await delay(200)
|
await delay(200)
|
||||||
|
|
@ -151,8 +153,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => {
|
||||||
|
|
||||||
if (shouldRetry(resolvedValue)) {
|
if (shouldRetry(resolvedValue)) {
|
||||||
logger.info(
|
logger.info(
|
||||||
'force retrying' +
|
'force retrying' /* +
|
||||||
` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}`
|
` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}`
|
||||||
|
*/
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return resolvedValue
|
return resolvedValue
|
||||||
|
|
@ -165,8 +168,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`\n retrying \n` +
|
`\n retrying \n` /* +
|
||||||
` args: ${promGen.toString()} -- ${shouldRetry.toString()}`
|
` args: ${promGen.toString()} -- ${shouldRetry.toString()}`
|
||||||
|
*/
|
||||||
)
|
)
|
||||||
|
|
||||||
await delay(3000)
|
await delay(3000)
|
||||||
|
|
@ -181,8 +185,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => {
|
||||||
|
|
||||||
if (shouldRetry(resolvedValue)) {
|
if (shouldRetry(resolvedValue)) {
|
||||||
logger.info(
|
logger.info(
|
||||||
'force retrying' +
|
'force retrying' /* +
|
||||||
` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}`
|
` args: ${promGen.toString()} -- ${shouldRetry.toString()} \n resolvedValue: ${resolvedValue}, type: ${typeof resolvedValue}`
|
||||||
|
*/
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return resolvedValue
|
return resolvedValue
|
||||||
|
|
@ -195,8 +200,9 @@ const tryAndWait = async (promGen, shouldRetry = () => false) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`\n NOT recreating a fresh gun but retrying one last time \n` +
|
`\n NOT recreating a fresh gun but retrying one last time \n` /* +
|
||||||
` args: ${promGen.toString()} -- ${shouldRetry.toString()}`
|
` args: ${promGen.toString()} -- ${shouldRetry.toString()}`
|
||||||
|
*/
|
||||||
)
|
)
|
||||||
|
|
||||||
const { gun, user } = require('../../Mediator/index').freshGun()
|
const { gun, user } = require('../../Mediator/index').freshGun()
|
||||||
|
|
|
||||||
|
|
@ -3160,6 +3160,13 @@ module.exports = async (
|
||||||
const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER)
|
const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER)
|
||||||
const { path, publicKey, type } = req.params
|
const { path, publicKey, type } = req.params
|
||||||
|
|
||||||
|
if (!publicKey || publicKey === 'undefined') {
|
||||||
|
res.status(400).json({
|
||||||
|
errorMessage: 'Invalid publicKey specified'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!allowedTypes.includes(type)) {
|
if (!allowedTypes.includes(type)) {
|
||||||
res.status(400).json({
|
res.status(400).json({
|
||||||
errorMessage: 'Invalid type specified'
|
errorMessage: 'Invalid type specified'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue