Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cms/models/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,14 @@ Item.schema.post("save", async function(doc, next) {
.select(Item.fullResponseFields.join(" "))
.exec();
} catch (err) {
logger.error("An error occurred finding item: ", err.message);
return next(new Error(`An error occurred finding item: ${err.message}`));
logger.error(
`An error occurred finding item: ${err.message}. Looking for item ${doc._id}`
);
return next(
new Error(
`An error occurred finding item: ${err.message}. Looking for item ${doc._id}`
)
);
}

const contentpath = process.env.CONTENT_PATH;
Expand Down
15 changes: 10 additions & 5 deletions cms/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cms/routes/api/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ exports.daily = async function(req, res) {
* /api/items/month/2020-01
*/
exports.month = async function(req, res) {
const start = Date.now();
const dateStr = req.params.date,
date = moment(dateStr, "YYYY-M", true);

Expand Down Expand Up @@ -130,6 +131,8 @@ exports.month = async function(req, res) {
const obj = _.map(items, _.partialRight(_.pick, Items.fullResponseFields));

res.json(obj);
const millis = Date.now() - start;
console.log(`seconds elapsed = ${Math.floor(millis / 1000)}`);
};

/**
Expand Down
1 change: 1 addition & 0 deletions lambda/MAS/Services/StaticWebsiteService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private async Task<PutObjectResponse> WriteFileAsync(StaticContentRequest item)
else
request.ContentBody = item.ContentBody;

_logger.LogDebug("TESTING THE LOGS !!!!!!!!!!!!!!!!!!!!!!!!!");
var response = await _amazonS3.PutObjectAsync(request);

return response;
Expand Down