mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix(#62): webhook plugins are stale for 60 minutes by default
This commit is contained in:
parent
c20e1a9a58
commit
a44479a48a
3 changed files with 30 additions and 4 deletions
|
|
@ -36,6 +36,10 @@ class Plugin extends Model
|
|||
|
||||
public function isDataStale(): bool
|
||||
{
|
||||
if ($this->data_strategy === 'webhook') {
|
||||
// Treat as stale if any webhook event has occurred in the past hour
|
||||
return $this->data_payload_updated_at && $this->data_payload_updated_at->gt(now()->subHour());
|
||||
}
|
||||
if (! $this->data_payload_updated_at || ! $this->data_stale_minutes) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue