fix crashes and report which object failed in walletd
This commit is contained in:
parent
89b8e391c9
commit
1d6e301b10
|
@ -122,7 +122,9 @@ export default {
|
|||
${SELECT}
|
||||
FROM "Item"
|
||||
WHERE id = $1`, Number(id))
|
||||
if (item) {
|
||||
item.comments = comments(models, id)
|
||||
}
|
||||
return item
|
||||
},
|
||||
userComments: async (parent, { userId }, { models }) => {
|
||||
|
|
|
@ -4,8 +4,13 @@ import path from 'path'
|
|||
export default async function handler (req, res) {
|
||||
const url = process.env.SELF_URL + '/' + path.join(...(req.query.path || []))
|
||||
res.setHeader('Content-Type', 'image/png')
|
||||
try {
|
||||
const streams = await new Pageres({ crop: true })
|
||||
.src(url, ['600x300'])
|
||||
.run()
|
||||
res.status(200).end(streams[0])
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
res.status(500)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,12 @@ import ApolloClient from '../../api/client'
|
|||
|
||||
// ssr the item without comments so that we can populate metatags
|
||||
export async function getServerSideProps ({ req, params: { id } }) {
|
||||
if (isNaN(id)) {
|
||||
return {
|
||||
notFound: true
|
||||
}
|
||||
}
|
||||
|
||||
const { error, data: { item } } = await (await ApolloClient(req)).query({
|
||||
query:
|
||||
gql`
|
||||
|
|
|
@ -57,7 +57,7 @@ async function checkPendingInvoices () {
|
|||
const inv = await getInvoice({ id: invoice.hash, lnd })
|
||||
await recordInvoiceStatus(inv)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
console.log(invoice, error)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
|
@ -106,7 +106,7 @@ async function checkPendingWithdrawls () {
|
|||
const wdrwl = await getPayment({ id: withdrawl.hash, lnd })
|
||||
await recordWithdrawlStatus(withdrawl.id, wdrwl)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
console.log(withdrawl, error)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue