diff --git a/app/routes/inngest+/utils/updateSiteAnalytics.server.ts b/app/routes/inngest+/utils/updateSiteAnalytics.server.ts index 6125f5d52..0442c94fa 100644 --- a/app/routes/inngest+/utils/updateSiteAnalytics.server.ts +++ b/app/routes/inngest+/utils/updateSiteAnalytics.server.ts @@ -282,9 +282,9 @@ export const updateSiteAnalytics = inngest.createFunction( await authGQLFetcher({ customPath: customCollection && !!siteDomain - ? `http://${siteDomain}:4000/api/graphql` + ? `https://${siteDomain}:4000/api/graphql` : customCollection && !!siteSlug - ? `http://${siteSlug}.mana.wiki:4000/api/graphql` + ? `https://${siteSlug}.mana.wiki:4000/api/graphql` : "https://mana.wiki/api/graphql", variables: { entrySlug: doc.entrySlug, @@ -351,9 +351,9 @@ export const updateSiteAnalytics = inngest.createFunction( await authGQLFetcher({ customPath: customCollection && !!siteDomain - ? `http://${siteDomain}:4000/api/graphql` + ? `https://${siteDomain}:4000/api/graphql` : customCollection && !!siteSlug - ? `http://${siteSlug}.mana.wiki:4000/api/graphql` + ? `https://${siteSlug}.mana.wiki:4000/api/graphql` : "https://mana.wiki/api/graphql", variables: { listSlug: doc.listSlug, @@ -429,7 +429,7 @@ export const updateSiteAnalytics = inngest.createFunction( if (collection.customDatabase == true) { const totalCustomEntries = await authRestFetcher({ method: "GET", - path: `http://${ + path: `https://${ siteDomain ? siteDomain : `${siteSlug}.mana.wiki` }:4000/api/${collection.slug}`, }); diff --git a/app/utils/fetchers.server.ts b/app/utils/fetchers.server.ts index ebb516b5e..3ebae01d5 100644 --- a/app/utils/fetchers.server.ts +++ b/app/utils/fetchers.server.ts @@ -27,6 +27,7 @@ export function authRestFetcher({ headers: { Authorization: `users API-Key ${process.env.MANA_APP_KEY}`, "Content-Type": "application/json", + connection: "keep-alive", }, }), ...(body && @@ -67,6 +68,7 @@ export function authGQLFetcher({ ...(process.env.MANA_APP_KEY && { Authorization: `users API-Key ${process.env.MANA_APP_KEY}`, }), + connection: "keep-alive", }, ); } catch (err) {