mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 02:13:56 +00:00
Merge pull request #2409 from overleaf/ta-recurly-collection-script-fix
Recurly Collection Script Fix GitOrigin-RevId: 3012d06a9122636ca1997e2e66899a36b386e5be
This commit is contained in:
parent
304a30887f
commit
508556c835
2 changed files with 14 additions and 3 deletions
|
@ -555,7 +555,7 @@ module.exports = RecurlyWrapper = {
|
|||
)
|
||||
cursor = __guard__(
|
||||
response.headers.link != null
|
||||
? response.headers.link.match(/cursor=([0-9]+%3A[0-9]+)&/)
|
||||
? response.headers.link.match(/cursor=([0-9.]+%3A[0-9.]+)&/)
|
||||
: undefined,
|
||||
x1 => x1[1]
|
||||
)
|
||||
|
|
|
@ -39,6 +39,7 @@ const attemptInvoiceCollection = (invoice, callback) => {
|
|||
callback
|
||||
)
|
||||
}
|
||||
INVOICES_COLLECTED_SUCCESS.push(invoice.invoice_number)
|
||||
slowCallback(callback, null)
|
||||
}
|
||||
)
|
||||
|
@ -75,6 +76,7 @@ const attemptInvoicesCollection = callback => {
|
|||
const argv = minimist(process.argv.slice(2))
|
||||
const DRY_RUN = argv.n !== undefined
|
||||
const INVOICES_COLLECTED = []
|
||||
const INVOICES_COLLECTED_SUCCESS = []
|
||||
const USERS_COLLECTED = []
|
||||
attemptInvoicesCollection(error => {
|
||||
if (error) {
|
||||
|
@ -83,8 +85,17 @@ attemptInvoicesCollection(error => {
|
|||
console.log(
|
||||
`DONE (DRY_RUN=${DRY_RUN}). ${
|
||||
INVOICES_COLLECTED.length
|
||||
} invoices collected for ${USERS_COLLECTED.length} users.`
|
||||
} invoices collection attempts for ${USERS_COLLECTED.length} users. ${
|
||||
INVOICES_COLLECTED_SUCCESS.length
|
||||
} successful collections`
|
||||
)
|
||||
console.dir(
|
||||
{
|
||||
INVOICES_COLLECTED,
|
||||
INVOICES_COLLECTED_SUCCESS,
|
||||
USERS_COLLECTED
|
||||
},
|
||||
{ maxArrayLength: null }
|
||||
)
|
||||
console.log({ INVOICES_COLLECTED, USERS_COLLECTED })
|
||||
process.exit()
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue