Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #3111, don't create S3 bucket on server startup (#3250)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb authored and jaredhirsch committed Aug 2, 2017
1 parent c250a6a commit e9b1458
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const http = require("http");
const https = require("https");
const gaActivation = require("./ga-activation");
const genUuid = require("nodify-uuid");
const AWS = require("aws-sdk");
const statsd = require("./statsd");
const { notFound } = require("./pages/not-found/server");
const { cacheTime, setCache } = require("./caching");
Expand All @@ -63,26 +62,6 @@ const PROXY_HEADER_WHITELIST = {

const COOKIE_EXPIRE_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days

if (config.useS3) {
// Test a PUT to s3 because configuring this requires using the aws web interface
// If the permissions are not set up correctly, then we want to know that asap
var s3bucket = new AWS.S3({params: {Bucket: config.s3BucketName}});
mozlog.info("creating-s3-bucket", {msg: `creating ${config.s3BucketName}`, bucketName: config.s3BucketName});

// createBucket is a horribly named api; it creates a local object to access
// an existing bucket
s3bucket.createBucket(function() {
var params = {Key: 'test', Body: 'Hello!'};
s3bucket.upload(params, function(error, data) {
if (error) {
mozlog.warn("test-upload-error", {msg: "Error uploading data during test", error, bucketName: config.s3BucketName});
} else {
mozlog.info("test-upload-success", {msg: `Successfully uploaded data to ${config.s3BucketName}/test`, bucketName: config.s3BucketName})
}
});
});
}

function initDatabase() {
let forceDbVersion = config.db.forceDbVersion;
if (forceDbVersion) {
Expand Down

0 comments on commit e9b1458

Please # to comment.