fix cron?
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 5m2s

This commit is contained in:
2025-12-18 21:00:49 -05:00
parent 87a87f9ba3
commit 029061e35b
3 changed files with 12 additions and 11 deletions

View File

@@ -14,4 +14,4 @@ jobs:
curl --request POST \
--url 'bot-stats.lucids-cove.duckdns.org/api/graphql' \
--header 'x-api-key: ${{ secrets.NEXT_PUBLIC_API_TOKEN }}' \
--data '{ "query": "Cron { cronJob( mutationKey: ${{ secrets.GRAPHQL_MUTATION_KEY }} ) { commandResponses createdAt linksDeleted timesTriggered updatedAt } }" }'
--data '{ "query": "mutation Cron { cronJob(mutationKey: \"${{ secrets.GRAPHQL_MUTATION_KEY }}\") { commandResponses createdAt linksDeleted timesTriggered updatedAt } }" }'

View File

@@ -1,6 +1,7 @@
/* eslint-disable no-unused-vars */
/* eslint-disable react-hooks/rules-of-hooks */
import { createYoga, Plugin, createSchema } from "graphql-yoga";
import { EnvelopArmorPlugin } from "@escape.tech/graphql-armor";
// import { EnvelopArmorPlugin } from "@escape.tech/graphql-armor";
import resolvers from "@/graphql/resolvers";
import typeDefs from "@/graphql/types";
@@ -59,10 +60,10 @@ const { handleRequest } = createYoga<NextContext>({
graphqlEndpoint: "/api/graphql",
// Yoga needs to know how to create a valid Next response
fetchAPI: { Response },
fetchAPI: { Response }
plugins: [useApiKey(), EnvelopArmorPlugin()],
graphiql: environment !== "production" ? true : false
// plugins: [useApiKey(), EnvelopArmorPlugin()],
// graphiql: environment !== "production" ? true : false
});
export {

View File

@@ -120,13 +120,13 @@ export const resolvers = {
}
}
const latestDailyStats = await getLatestDailyStat();
// const latestDailyStats = await getLatestDailyStat();
if (latestDailyStats !== null) {
if (isDailyStatToday(String(latestDailyStats.createdAt))) {
return null;
}
}
// if (latestDailyStats !== null) {
// if (isDailyStatToday(String(latestDailyStats.createdAt))) {
// return null;
// }
// }
const date = new Date().toISOString();