mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
more aws graceful
This commit is contained in:
parent
3301db8d0e
commit
3e570577b2
@ -1,9 +1,20 @@
|
|||||||
const log = require('fancy-log');
|
const log = require('fancy-log');
|
||||||
const aws = require('aws-sdk');
|
const aws = require('aws-sdk');
|
||||||
var credentials = require('../aws.json');
|
|
||||||
var Promise = require('bluebird');
|
var Promise = require('bluebird');
|
||||||
|
|
||||||
|
var credentials;
|
||||||
|
try {
|
||||||
|
credentials = require('../aws.json');
|
||||||
|
} catch (e) {
|
||||||
|
credentials = null;
|
||||||
|
}
|
||||||
|
|
||||||
async function invalidate (wait) {
|
async function invalidate (wait) {
|
||||||
|
if (!credentials) {
|
||||||
|
console.error('Cannot access cloudfront without AWS credentials present.'); // eslint-disable-line
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var cloudfront = new aws.CloudFront();
|
var cloudfront = new aws.CloudFront();
|
||||||
cloudfront.config.update({ credentials });
|
cloudfront.config.update({ credentials });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user