Преглед изворни кода

Merge pull request #4242 from overleaf/ho-paypal-script-exit-code

exit with non zero code when no invoicess were processed

GitOrigin-RevId: df449964fc830f689d972d9ad3ed6b352c1b7c5c
Eric Mc Sween пре 5 година
родитељ
комит
e6b805b885
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      services/web/scripts/recurly/collect_paypal_past_due_invoice.js

+ 6 - 1
services/web/scripts/recurly/collect_paypal_past_due_invoice.js

@@ -93,5 +93,10 @@ attemptInvoicesCollection(error => {
     },
     },
     { maxArrayLength: null }
     { maxArrayLength: null }
   )
   )
-  process.exit()
+
+  if (INVOICES_COLLECTED_SUCCESS === 0) {
+    process.exit(1)
+  } else {
+    process.exit()
+  }
 })
 })