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 \
|
curl --request POST \
|
||||||
--url 'bot-stats.lucids-cove.duckdns.org/api/graphql' \
|
--url 'bot-stats.lucids-cove.duckdns.org/api/graphql' \
|
||||||
--header 'x-api-key: ${{ secrets.NEXT_PUBLIC_API_TOKEN }}' \
|
--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 */
|
/* eslint-disable react-hooks/rules-of-hooks */
|
||||||
import { createYoga, Plugin, createSchema } from "graphql-yoga";
|
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 resolvers from "@/graphql/resolvers";
|
||||||
import typeDefs from "@/graphql/types";
|
import typeDefs from "@/graphql/types";
|
||||||
|
|
||||||
@@ -59,10 +60,10 @@ const { handleRequest } = createYoga<NextContext>({
|
|||||||
graphqlEndpoint: "/api/graphql",
|
graphqlEndpoint: "/api/graphql",
|
||||||
|
|
||||||
// Yoga needs to know how to create a valid Next response
|
// Yoga needs to know how to create a valid Next response
|
||||||
fetchAPI: { Response },
|
fetchAPI: { Response }
|
||||||
|
|
||||||
plugins: [useApiKey(), EnvelopArmorPlugin()],
|
// plugins: [useApiKey(), EnvelopArmorPlugin()],
|
||||||
graphiql: environment !== "production" ? true : false
|
// graphiql: environment !== "production" ? true : false
|
||||||
});
|
});
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|||||||
@@ -120,13 +120,13 @@ export const resolvers = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const latestDailyStats = await getLatestDailyStat();
|
// const latestDailyStats = await getLatestDailyStat();
|
||||||
|
|
||||||
if (latestDailyStats !== null) {
|
// if (latestDailyStats !== null) {
|
||||||
if (isDailyStatToday(String(latestDailyStats.createdAt))) {
|
// if (isDailyStatToday(String(latestDailyStats.createdAt))) {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
const date = new Date().toISOString();
|
const date = new Date().toISOString();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user