Compare commits
2 Commits
7e5a8310df
...
d1c770dbbc
Author | SHA1 | Date |
---|---|---|
k00b | d1c770dbbc | |
k00b | cb8cce77f0 |
|
@ -675,6 +675,16 @@ const resolvers = {
|
|||
export default injectResolvers(resolvers)
|
||||
|
||||
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
|
||||
const log = (level) => async (message, context = {}) => {
|
||||
try {
|
||||
|
|
|
@ -414,7 +414,7 @@ export async function checkPendingDeposits (args) {
|
|||
const pendingDeposits = await models.invoice.findMany({ where: { confirmedAt: null, cancelled: false } })
|
||||
for (const d of pendingDeposits) {
|
||||
try {
|
||||
await checkInvoice({ data: { hash: d.hash }, ...args })
|
||||
await checkInvoice({ ...args, data: { hash: d.hash } })
|
||||
await sleep(10)
|
||||
} catch {
|
||||
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 } })
|
||||
for (const w of pendingWithdrawals) {
|
||||
try {
|
||||
await checkWithdrawal({ data: { hash: w.hash }, ...args })
|
||||
await checkWithdrawal({ ...args, data: { hash: w.hash } })
|
||||
await sleep(10)
|
||||
} catch (err) {
|
||||
console.error('error checking withdrawal', w.hash, err)
|
||||
|
|
Loading…
Reference in New Issue