jdavidbakr / mail-tracker

Package for Laravel to inject tracking code into outgoing emails.
MIT License
574 stars 129 forks source link

Handle exceptions better #226

Closed bretto36 closed 1 year ago

bretto36 commented 1 year ago

So i have an issue where a really long link is triggering a DB exception. Which is causing the job to fail, which then retries as we have retryUntil for 5 days! Should this be 5 minutes instead? 5 days seems like alot, so i'm introducing max exceptions. My current issue is the Sent Email entry clicks is being incremented each timeit fails but it can't create the SentEmailUrlClicked entry so retries the job. Sent Email entry was at 20000 clicks before i saw it.

A diff solution would be to change the retryUntil to be shorter. Not sure what the use case was for that to be introduced

public function retryUntil()
    {
        return now()->addDays(5);
    }