Skip to content

Commit

Permalink
socket hang up fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pogseal committed Aug 19, 2024
1 parent b417a97 commit 866d576
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/routes/inngest+/utils/updateSiteAnalytics.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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}`,
});
Expand Down
2 changes: 2 additions & 0 deletions app/utils/fetchers.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 866d576

Please sign in to comment.