Merge pull request #8270 from turbo124/v5-develop

Fixes for job middleware
This commit is contained in:
David Bomba 2023-02-09 12:23:59 +11:00 committed by GitHub
commit 95e0aa6547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 16 deletions

View File

@ -1 +1 @@
5.5.69 5.5.70

View File

@ -106,6 +106,7 @@ class Import implements ShouldQueue
use CleanLineItems; use CleanLineItems;
use Uploadable; use Uploadable;
use SavesDocuments; use SavesDocuments;
/** /**
* @var array * @var array
*/ */
@ -188,10 +189,10 @@ class Import implements ShouldQueue
$this->resources = $resources; $this->resources = $resources;
} }
// public function middleware() public function middleware()
// { {
// return [new WithoutOverlapping("only_one_migration_at_a_time_ever")]; return [(new WithoutOverlapping($this->user->account_id))];
// } }
/** /**
* Execute the job. * Execute the job.
@ -1897,6 +1898,8 @@ class Import implements ShouldQueue
{ {
info('the job failed'); info('the job failed');
config(['queue.failed.driver' => null]);
$job_failure = new MigrationFailure(); $job_failure = new MigrationFailure();
$job_failure->string_metric5 = get_class($this); $job_failure->string_metric5 = get_class($this);
$job_failure->string_metric6 = $exception->getMessage(); $job_failure->string_metric6 = $exception->getMessage();
@ -1951,7 +1954,6 @@ class Import implements ShouldQueue
} }
/* In V4 we use negative invoices (credits) and add then into the client balance. In V5, these sit off ledger and are applied later. /* In V4 we use negative invoices (credits) and add then into the client balance. In V5, these sit off ledger and are applied later.
This next section will check for credit balances and reduce the client balance so that the V5 balances are correct This next section will check for credit balances and reduce the client balance so that the V5 balances are correct
*/ */

View File

@ -52,14 +52,9 @@ class BankMatchingService implements ShouldQueue
} }
/** public function middleware()
* The unique ID of the job. {
* return [(new WithoutOverlapping($this->company_id))];
* @return string
*/
public function uniqueId()
{
return (string)$this->company_id;
} }
} }

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.5.69', 'app_version' => '5.5.70',
'app_tag' => '5.5.69', 'app_tag' => '5.5.70',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),