testing the test
Some checks failed
Deploy App / docker (ubuntu-latest) (push) Failing after 41s

This commit is contained in:
Lee 2024-04-22 14:21:09 +01:00
parent 40029b9839
commit 9ba13d1160
2 changed files with 9 additions and 10 deletions

View File

@ -13,10 +13,7 @@ import { Metadata, Viewport } from "next";
import { ReactElement } from "react";
import { Title } from "@/app/components/title";
/**
* Force the page to be dynamic, so it will be regenerated on every request
*/
export const revalidate = 0;
export const revalidate = 60;
type Params = {
params: {
@ -24,6 +21,11 @@ type Params = {
};
};
export async function getData(id: string): Promise<CachedPlayer> {
console.log("called");
return getPlayer(id);
}
export async function generateViewport({ params: { id } }: Params): Promise<Viewport> {
const validPlayer = await isValidPlayer(id);
return {
@ -41,7 +43,7 @@ export async function generateMetadata({ params: { id } }: Params): Promise<Meta
}
try {
const { username, uniqueId, skin } = await getPlayer(id);
const { username, uniqueId, skin } = await getData(id);
const headPartUrl = skin.parts.head;
return generateEmbed({
@ -64,7 +66,7 @@ export default async function Page({ params: { id } }: Params): Promise<ReactEle
// Try and get the player to display
try {
player = id ? await getPlayer(id) : undefined;
player = id ? await getData(id) : undefined;
} catch (err) {
error = (err as McUtilsAPIError).message; // Set the error message
}

View File

@ -20,10 +20,7 @@ import { Metadata, Viewport } from "next";
import { ReactElement } from "react";
import { Title } from "@/app/components/title";
/**
* Force the page to be dynamic, so it will be regenerated on every request
*/
export const revalidate = 0;
export const revalidate = 60;
type Params = {
params: {