diff --git a/laravel_app/app/Livewire/Components/DownloadNotification.php b/laravel_app/app/Livewire/Components/DownloadNotification.php index 83ea626..0a1326d 100644 --- a/laravel_app/app/Livewire/Components/DownloadNotification.php +++ b/laravel_app/app/Livewire/Components/DownloadNotification.php @@ -10,7 +10,7 @@ class DownloadNotification extends Component { public $show_download_notification; public Project $project; - + // TODO Change session bool to timestamp so i can check if i show it in 5 min. public function mount(Project $project) { $this->show_download_notification = session()->get('show-download.'.$project->id,$project->hasMissingDownloadsDateInHarvestFile()); diff --git a/laravel_app/app/Models/Project.php b/laravel_app/app/Models/Project.php index c2b920b..0b274d4 100644 --- a/laravel_app/app/Models/Project.php +++ b/laravel_app/app/Models/Project.php @@ -350,18 +350,18 @@ public function getMosaicsFor(Carbon $endDate, int $offset= 7): array public function handleMissingDownloads() { - $this->getMissingDownloadsDateInHarvestFile() + $this->getMissingDownloads() ->each(function(Carbon $date){ - ProjectDownloadTiffJob::handleForDate($this,$date); + dispatch(ProjectDownloadTiffJob::handleForDate($this,$date)); }); } public function hasMissingDownloadsDateInHarvestFile():bool { - return $this->getMissingDownloadsDateInHarvestFile()->count() > 0; + return $this->getMissingDownloads()->count() > 0; } - public function getMissingDownloadsDateInHarvestFile():Collection + public function getMissingDownloads():Collection { if(!$this->harvest_json_path || !$this->min_harvest_date){ return collect([]);