mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Implement throttling on Gateway Import Customer Router
This commit is contained in:
parent
d353bfc52a
commit
d72c6508de
@ -565,9 +565,11 @@ class CompanyGatewayController extends BaseController
|
||||
|
||||
public function importCustomers(TestCompanyGatewayRequest $request, CompanyGateway $company_gateway)
|
||||
{
|
||||
// $x = Cache::pull("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}");
|
||||
|
||||
//Throttle here
|
||||
// if (Cache::get("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}"))
|
||||
// return response()->json(['message' => ctrans('texts.import_started')], 200);
|
||||
if (Cache::has("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}"))
|
||||
return response()->json(['message' => 'Please wait whilst your previous attempts complete.'], 200);
|
||||
|
||||
dispatch(function () use($company_gateway) {
|
||||
MultiDB::setDb($company_gateway->company->db);
|
||||
|
@ -103,7 +103,7 @@ class AuthorizeCustomer
|
||||
} else {
|
||||
// nlog("creating client");
|
||||
|
||||
$first_payment_profile = $profile['payment_profiles'][0];
|
||||
$first_payment_profile = &$profile['payment_profiles'][0];
|
||||
|
||||
if (! $first_payment_profile) {
|
||||
continue;
|
||||
|
@ -195,6 +195,8 @@ class AuthorizePaymentDriver extends BaseDriver
|
||||
{
|
||||
$this->init();
|
||||
|
||||
nlog("starting import auth.net");
|
||||
|
||||
return (new AuthorizeCustomer($this))->importCustomers();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user