Store copy of import data on private disk for debugging

Re-adds the copy of the import data that was removed in 70646a0d. Every import stores its raw data in import/{date}-{organizationId}-{uuid} on the private disk.
This commit is contained in:
Constantin Graf
2026-10-14 10:30:53 +02:00
committed by Constantin Graf
parent 65525791a6
commit 0b2a417788
2 changed files with 13 additions and 4 deletions

View File

@@ -9,8 +9,11 @@ use App\Service\Import\Importers\ImporterContract;
use App\Service\Import\Importers\ImporterProvider;
use App\Service\Import\Importers\ImportException;
use App\Service\Import\Importers\ReportDto;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
class ImportService
{
@@ -22,6 +25,8 @@ class ImportService
/** @var ImporterContract $importer */
$importer = app(ImporterProvider::class)->getImporter($importerType);
$importer->init($organization);
Storage::disk(config('filesystems.private'))
->put('import/'.Carbon::now()->toDateString().'-'.$organization->getKey().'-'.Str::uuid(), $data);
$lock = Cache::lock('import:'.$organization->getKey(), config('octane.max_execution_time', 60) + 1);