@@ -411,7 +411,7 @@ function () use ($migration, $transfer, $project, $queueForRealtime) {
411411 $ source ?->success();
412412
413413 if ($ migration ->getAttribute ('destination ' ) === DestinationCSV::getName ()) {
414- $ this ->handleCSVExportComplete ($ project , $ migration , $ queueForMails );
414+ $ this ->handleCSVExportComplete ($ project , $ migration , $ queueForMails, $ queueForRealtime );
415415 }
416416 }
417417 }
@@ -432,7 +432,8 @@ function () use ($migration, $transfer, $project, $queueForRealtime) {
432432 protected function handleCSVExportComplete (
433433 Document $ project ,
434434 Document $ migration ,
435- Mail $ queueForMails
435+ Mail $ queueForMails ,
436+ Realtime $ queueForRealtime ,
436437 ): void {
437438 $ options = $ migration ->getAttribute ('options ' , []);
438439 $ bucketId = 'default ' ; // Always use platform default bucket
@@ -530,6 +531,9 @@ protected function handleCSVExportComplete(
530531 $ endpoint = System::getEnv ('_APP_DOMAIN ' , '' );
531532 $ protocol = System::getEnv ('_APP_OPTIONS_FORCE_HTTPS ' , 'disabled ' ) === 'enabled ' ? 'https ' : 'http ' ;
532533 $ downloadUrl = "{$ protocol }:// {$ endpoint }/v1/storage/buckets/ {$ bucketId }/files/ {$ fileId }/push?project= {$ project ->getId ()}&jwt= {$ jwt }" ;
534+ $ options ['downloadUrl ' ] = $ downloadUrl ;
535+ $ migration ->setAttribute ('options ' , $ options );
536+ $ this ->updateMigrationDocument ($ migration , $ project , $ queueForRealtime );
533537
534538 $ this ->sendCSVEmail (
535539 success: true ,
0 commit comments