Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
fix: make local deploy work without internet. Closes #2488
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jun 5, 2018
1 parent 86e28a9 commit f0b7306
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions cli/packages/prisma-yml/src/Environment.ts
Expand Up @@ -81,14 +81,15 @@ export class Environment {
if (this.cloudSessionKey) {
this.renewToken()
try {
const res = await fetch('https://api.cloud.prisma.sh', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.cloudSessionKey}`,
} as any,
body: JSON.stringify({
query: `
const res = (await Promise.race([
fetch('https://api.cloud.prisma.sh', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.cloudSessionKey}`,
} as any,
body: JSON.stringify({
query: `
{
me {
memberships {
Expand All @@ -110,9 +111,14 @@ export class Environment {
}
}
`,
}),
agent: getProxyAgent('https://api.cloud.prisma.sh'),
} as any)
}),
agent: getProxyAgent('https://api.cloud.prisma.sh'),
} as any),
new Promise((_, r) => setTimeout(() => r(), 6000)),
])) as any
if (!res) {
return
}
const json = await res.json()
if (
json &&
Expand Down

0 comments on commit f0b7306

Please sign in to comment.