Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/AbstractUseStaleRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ protected function responseFromCache(): ?Response
->setReadCache(false)
->setWriteCache(true)
->sync();
} catch (\Throwable) {
// Nobody cares, this is literally what use-stale is good at
} catch (\Throwable $e) {
$reRequest->onBackgroundRefreshFailed($e);
}
});
}
Expand Down Expand Up @@ -78,6 +78,8 @@ public function purgeCache(): self
return parent::purgeCache();
}

protected function onBackgroundRefreshFailed(\Throwable $e): void {}

// Children of this class are *required* to thoughtfully implement their own PHP 8.1+ style serialization,
// to work with `dispatch` in `responseFromCache`
// https://php.watch/versions/8.1/serializable-deprecated
Expand Down