better logs

This commit is contained in:
Daniel Lugo 2020-02-27 13:33:02 -04:00
parent a214a4cd56
commit e2c1c8fa0b

View file

@ -34,15 +34,17 @@ const onAcceptedRequests = (user, SEA) => {
.map() .map()
.once(async (storedReq, id) => { .once(async (storedReq, id) => {
logger.info( logger.info(
`------------------------------------\nPROCID:${procid}\n---------------------------------------` `------------------------------------\nPROCID:${procid} (used for debugging memory leaks in jobs)\n---------------------------------------`
) )
const mySecret = require('../../Mediator').getMySecret() const mySecret = require('../../Mediator').getMySecret()
try { try {
if (!Schema.isStoredRequest(storedReq)) { if (!Schema.isStoredRequest(storedReq)) {
throw new TypeError( logger.warn(
'Stored request not an StoredRequest, instead got: ' + 'Stored request not an StoredRequest, instead got: ' +
JSON.stringify(storedReq) JSON.stringify(storedReq) +
' this can be due to nulling out an old request (if null) or something else happened (please look at the output)'
) )
return
} }
const recipientPub = await SEA.decrypt(storedReq.recipientPub, mySecret) const recipientPub = await SEA.decrypt(storedReq.recipientPub, mySecret)