spatie / laravel-webhook-client

Receive webhooks in Laravel apps
https://freek.dev/1383-sending-and-receiving-webhooks-in-laravel-apps
MIT License
1k stars 147 forks source link

perf: save exception as null by default :rocket: #191

Closed ankurk91 closed 1 year ago

ankurk91 commented 1 year ago

Hi @freekmurze

While profiling our Laravel app via Sentry, we found that this package is making one extra SQL query on each incoming webhook request.

This package saves the model and then dispatch the respective job, but it also clears any saved exception before as well.

Web capture_2-5-2023_18204

Saving the exception as null will let Laravel know that the model is not dirty and Laravel will skip updating the row automatically.

This will save around 10k SQL queries daily on our server. :smile:

Thanks again for this wonderful package.

freekmurze commented 1 year ago

Thanks!