mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-25 12:27:16 +00:00
Merge pull request #33 from dustinrouillard/main
This commit is contained in:
@@ -98,7 +98,10 @@ export default function Home({ userCount }: { userCount: number }) {
|
||||
}
|
||||
|
||||
export async function getServerSideProps(ctx: any) {
|
||||
let userCount = await axios.get("https://lanyard.cnrad.dev/api/getUserCount").then(res => res.data.count);
|
||||
let userCount = await axios
|
||||
.get("https://lanyard.cnrad.dev/api/getUserCount", { timeout: 1000 })
|
||||
.then(res => res.data.count)
|
||||
.catch(() => 0);
|
||||
|
||||
return {
|
||||
props: { userCount },
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import Redis from "ioredis";
|
||||
|
||||
const redis = new Redis(process.env.REDIS_URL);
|
||||
const redis = new Redis(process.env.REDIS_URL, {
|
||||
connectTimeout: 1000,
|
||||
lazyConnect: false,
|
||||
maxRetriesPerRequest: 1,
|
||||
});
|
||||
|
||||
export default redis;
|
||||
|
||||
Reference in New Issue
Block a user