refactor: replace qstash with Google Cloud Tasks
This commit is contained in:
@@ -4,19 +4,14 @@ import { DateTime } from "luxon";
|
||||
|
||||
import { getAdminSdkCredentials } from "~/libs/gcloud/getAdminSdkCredentials";
|
||||
import { sendFcmMessage } from "~/libs/gcloud/sendFcmMessage";
|
||||
import { verifyQstashHeader } from "~/libs/qstash/verifyQstashHeader";
|
||||
import type { Env } from "~/types/env";
|
||||
import { ErrorResponse, SuccessResponse } from "~/types/schema";
|
||||
import { SuccessResponse } from "~/types/schema";
|
||||
|
||||
import { getUpcomingTitlesFromAnilist } from "./anilist";
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
app.post("/", async (c) => {
|
||||
if (!(await verifyQstashHeader(env<Env, typeof c>(c, "workerd"), c.req))) {
|
||||
return c.json(ErrorResponse, { status: 401 });
|
||||
}
|
||||
|
||||
const titles = await getUpcomingTitlesFromAnilist(
|
||||
env<Env, typeof c>(c, "workerd"),
|
||||
c.req,
|
||||
|
||||
Reference in New Issue
Block a user