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';
|
||||
|
||||
// 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;
|
||||
|
||||
|
|
|
@ -62,11 +62,18 @@ async function fetchPackageInfo(packageName, log) {
|
|||
return bufferStream(res).then(JSON.parse);
|
||||
}
|
||||
|
||||
if (res.statusCode === 404) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const content = (await bufferStream(res)).toString('utf-8');
|
||||
|
||||
log.error('Failed to fetch info for %s', packageName);
|
||||
log.error('Status: %s', res.statusCode);
|
||||
log.error('Content: %s', content);
|
||||
log.error(
|
||||
'Error fetching info for %s (status: %s)',
|
||||
packageName,
|
||||
res.statusCode
|
||||
);
|
||||
log.error(content);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -181,11 +188,19 @@ export async function getPackage(packageName, version, log) {
|
|||
return stream;
|
||||
}
|
||||
|
||||
if (res.statusCode === 404) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const content = (await bufferStream(res)).toString('utf-8');
|
||||
|
||||
log.error('Failed to fetch tarball for %s@%s', packageName, version);
|
||||
log.error('Status: %s', res.statusCode);
|
||||
log.error('Content: %s', content);
|
||||
log.error(
|
||||
'Error fetching tarball for %s@%s (status: %s)',
|
||||
packageName,
|
||||
version,
|
||||
res.statusCode
|
||||
);
|
||||
log.error(content);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue