diff --git a/app/Jobs/RecalculateSpentTimeForProject.php b/app/Jobs/RecalculateSpentTimeForProject.php index 024e19d6..6ad375ce 100644 --- a/app/Jobs/RecalculateSpentTimeForProject.php +++ b/app/Jobs/RecalculateSpentTimeForProject.php @@ -20,6 +20,11 @@ class RecalculateSpentTimeForProject implements ShouldDispatchAfterCommit, Shoul use Queueable; use SerializesModels; + /** + * Delete the job if its models no longer exist. + */ + public bool $deleteWhenMissingModels = true; + public Project $project; /** diff --git a/app/Jobs/RecalculateSpentTimeForTask.php b/app/Jobs/RecalculateSpentTimeForTask.php index 5f04dc6e..649bc8e9 100644 --- a/app/Jobs/RecalculateSpentTimeForTask.php +++ b/app/Jobs/RecalculateSpentTimeForTask.php @@ -20,6 +20,11 @@ class RecalculateSpentTimeForTask implements ShouldDispatchAfterCommit, ShouldQu use Queueable; use SerializesModels; + /** + * Delete the job if its models no longer exist. + */ + public bool $deleteWhenMissingModels = true; + public Task $task; /**