Compare commits
2 Commits
7e5a8310df
...
d1c770dbbc
Author | SHA1 | Date | |
---|---|---|---|
|
d1c770dbbc | ||
|
cb8cce77f0 |
@ -675,6 +675,16 @@ const resolvers = {
|
|||||||
export default injectResolvers(resolvers)
|
export default injectResolvers(resolvers)
|
||||||
|
|
||||||
export const walletLogger = ({ wallet, models }) => {
|
export const walletLogger = ({ wallet, models }) => {
|
||||||
|
// no-op logger if wallet is not provided
|
||||||
|
if (!wallet) {
|
||||||
|
return {
|
||||||
|
ok: () => {},
|
||||||
|
info: () => {},
|
||||||
|
error: () => {},
|
||||||
|
warn: () => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// server implementation of wallet logger interface on client
|
// server implementation of wallet logger interface on client
|
||||||
const log = (level) => async (message, context = {}) => {
|
const log = (level) => async (message, context = {}) => {
|
||||||
try {
|
try {
|
||||||
|
@ -414,7 +414,7 @@ export async function checkPendingDeposits (args) {
|
|||||||
const pendingDeposits = await models.invoice.findMany({ where: { confirmedAt: null, cancelled: false } })
|
const pendingDeposits = await models.invoice.findMany({ where: { confirmedAt: null, cancelled: false } })
|
||||||
for (const d of pendingDeposits) {
|
for (const d of pendingDeposits) {
|
||||||
try {
|
try {
|
||||||
await checkInvoice({ data: { hash: d.hash }, ...args })
|
await checkInvoice({ ...args, data: { hash: d.hash } })
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
} catch {
|
} catch {
|
||||||
console.error('error checking invoice', d.hash)
|
console.error('error checking invoice', d.hash)
|
||||||
@ -427,7 +427,7 @@ export async function checkPendingWithdrawals (args) {
|
|||||||
const pendingWithdrawals = await models.withdrawl.findMany({ where: { status: null } })
|
const pendingWithdrawals = await models.withdrawl.findMany({ where: { status: null } })
|
||||||
for (const w of pendingWithdrawals) {
|
for (const w of pendingWithdrawals) {
|
||||||
try {
|
try {
|
||||||
await checkWithdrawal({ data: { hash: w.hash }, ...args })
|
await checkWithdrawal({ ...args, data: { hash: w.hash } })
|
||||||
await sleep(10)
|
await sleep(10)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('error checking withdrawal', w.hash, err)
|
console.error('error checking withdrawal', w.hash, err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user