Use GOOGLE_CLOUD_PROJECT instead of GAE_APPLICATION
This commit is contained in:
parent
370a7f7d6c
commit
8aa619727e
|
@ -1,7 +1,7 @@
|
||||||
import util from 'util';
|
import util from 'util';
|
||||||
|
|
||||||
// https://cloud.google.com/appengine/docs/standard/nodejs/runtime#environment_variables
|
// https://cloud.google.com/appengine/docs/standard/nodejs/runtime#environment_variables
|
||||||
const projectId = process.env.GAE_APPLICATION;
|
const projectId = process.env.GOOGLE_CLOUD_PROJECT;
|
||||||
|
|
||||||
const enableDebugging = process.env.DEBUG != null;
|
const enableDebugging = process.env.DEBUG != null;
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,18 @@ async function fetchPackageInfo(packageName, log) {
|
||||||
return bufferStream(res).then(JSON.parse);
|
return bufferStream(res).then(JSON.parse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.statusCode === 404) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const content = (await bufferStream(res)).toString('utf-8');
|
const content = (await bufferStream(res)).toString('utf-8');
|
||||||
|
|
||||||
log.error('Failed to fetch info for %s', packageName);
|
log.error(
|
||||||
log.error('Status: %s', res.statusCode);
|
'Error fetching info for %s (status: %s)',
|
||||||
log.error('Content: %s', content);
|
packageName,
|
||||||
|
res.statusCode
|
||||||
|
);
|
||||||
|
log.error(content);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -181,11 +188,19 @@ export async function getPackage(packageName, version, log) {
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.statusCode === 404) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const content = (await bufferStream(res)).toString('utf-8');
|
const content = (await bufferStream(res)).toString('utf-8');
|
||||||
|
|
||||||
log.error('Failed to fetch tarball for %s@%s', packageName, version);
|
log.error(
|
||||||
log.error('Status: %s', res.statusCode);
|
'Error fetching tarball for %s@%s (status: %s)',
|
||||||
log.error('Content: %s', content);
|
packageName,
|
||||||
|
version,
|
||||||
|
res.statusCode
|
||||||
|
);
|
||||||
|
log.error(content);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue