fix(news): persist publication requests and retry cache delivery
This commit is contained in:
1 parent
c977fe95ba
commit
52f6d1491f
40 files changed
+733
-134
No files matched your search
@@ -18,7 +18,11 @@ vi.mock("@/lib/cache", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
import { cacheNews, invalidateNewsCache } from "./news-cache";
|
||||
import {
|
||||
cacheNews,
|
||||
invalidateNewsCache,
|
||||
refreshNewsCacheForDelivery,
|
||||
} from "./news-cache";
|
||||
|
||||
beforeEach(() => {
|
||||
state.values.clear();
|
||||
@@ -65,3 +69,12 @@ it("reads fresh data when Redis is unavailable", async () => {
|
||||
"fresh",
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps failed durable cache invalidations retryable", async () => {
|
||||
state.set.mockRejectedValue(Error("offline"));
|
||||
await expect(refreshNewsCacheForDelivery()).rejects.toThrow("offline");
|
||||
});
|
||||
it("does not acknowledge an ended Redis connection as refreshed", async () => {
|
||||
state.status = "end";
|
||||
await expect(refreshNewsCacheForDelivery()).rejects.toThrow();
|
||||
});
|
||||
Reference in new issue
Block a user