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