feat: Add durable object for Anilist requests (#2)

This commit introduces a durable object to handle Anilist GraphQL requests, with the goal of preventing request duplication.

The durable object is designed to cache responses from the Anilist API, with a TTL based on the `nextAiringEpisode` field in the response.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
2025-11-14 13:07:36 +08:00
committed by GitHub
parent f6a3ea2649
commit 959265484c
6 changed files with 1258 additions and 133 deletions

View File

@@ -67,9 +67,4 @@ app.get("/docs", swaggerUI({ url: "/openapi.json" }));
export default app;
export class AniwatchApiContainer /* extends Container */ {
// Port the container listens on (default: 8080)
defaultPort = 4444;
// Time before container sleeps due to inactivity (default: 30s)
sleepAfter = "2m";
}
export { AnilistDurableObject as AnilistDo } from "~/libs/anilist/anilist-do.ts";