fix(#62): webhook plugins are stale for 60 minutes by default

This commit is contained in:
Benjamin Nussbaum 2025-07-10 23:50:41 +02:00
parent c20e1a9a58
commit a44479a48a
3 changed files with 30 additions and 4 deletions

View file

@ -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;
}