fix cron?
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 5m2s
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 5m2s
This commit is contained in:
2
.github/workflows/cron.yml
vendored
2
.github/workflows/cron.yml
vendored
@@ -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 } }" }'
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user