|
@@ -33,7 +33,7 @@ discard block |
|
|
block discarded – undo |
|
33
|
33
|
$recordsSince = TenantPerson::orderBy('updated_at', 'desc')->first()?->updated_at; |
|
34
|
34
|
$this->info('Tenant people records syncronization since: '.($recordsSince ?: 'start')); |
|
35
|
35
|
|
|
36
|
|
- tenancy()->query()->cursor()->each(function (Tenant $tenant) use ($recordsSince) { |
|
|
36
|
+ tenancy()->query()->cursor()->each(function(Tenant $tenant) use ($recordsSince) { |
|
37
|
37
|
try { |
|
38
|
38
|
tenancy()->initialize($tenant); |
|
39
|
39
|
|
|
@@ -44,7 +44,7 @@ discard block |
|
|
block discarded – undo |
|
44
|
44
|
} |
|
45
|
45
|
|
|
46
|
46
|
$this->info('Processing tenant #'.$tenant->id.' records: '.(clone $tenantPersonQuery)->count()); |
|
47
|
|
- $tenantPersonQuery->chunk(100, function ($people) use ($tenant) { |
|
|
47
|
+ $tenantPersonQuery->chunk(100, function($people) use ($tenant) { |
|
48
|
48
|
// clear old records and push updated ones |
|
49
|
49
|
TenantPerson::where('tenant_id', $tenant->id) |
|
50
|
50
|
->whereIn('tenant_person_id', $people->pluck('id')) |
Please login to merge, or discard this patch.