Merged in feature/IO-2520-Kaizen-Data-Pump (pull request #1655)
IO-2520 Change Logging back to default and adjust start and end to be default Approved-by: Dave Richer
This commit is contained in:
@@ -56,8 +56,8 @@ exports.default = async (req, res) => {
|
||||
try {
|
||||
const { jobs, bodyshops_by_pk } = await client.request(queries.KAIZEN_QUERY, {
|
||||
bodyshopid: bodyshop.id,
|
||||
start: start ? moment(start).startOf("hours") : moment().subtract(2, "hours").startOf("hour"),
|
||||
...(end && { end: moment(end).endOf("hours") })
|
||||
start: start ? moment(start).startOf("day") : moment().subtract(5, "days").startOf("day"),
|
||||
...(end && { end: moment(end).endOf("day") })
|
||||
});
|
||||
|
||||
const kaizenObject = {
|
||||
@@ -176,24 +176,19 @@ exports.default = async (req, res) => {
|
||||
} finally {
|
||||
sftp.end();
|
||||
}
|
||||
// sendServerEmail({
|
||||
// subject: `Kaizen Report ${moment().format("MM-DD-YY")}`,
|
||||
// text: `Errors: ${allErrors.map((e) => JSON.stringify(e, null, 2))}
|
||||
// Uploaded: ${JSON.stringify(
|
||||
// allxmlsToUpload.map((x) => ({ filename: x.filename, count: x.count })),
|
||||
// null,
|
||||
// 2
|
||||
// )}
|
||||
// `,
|
||||
// });
|
||||
sendServerEmail({
|
||||
subject: `Kaizen Report ${moment().format("MM-DD-YY")}`,
|
||||
text: `Errors: ${allErrors.map((e) => JSON.stringify(e, null, 2))}
|
||||
Uploaded: ${JSON.stringify(
|
||||
allxmlsToUpload.map((x) => ({ filename: x.filename, count: x.count })),
|
||||
null,
|
||||
2
|
||||
)}
|
||||
`
|
||||
});
|
||||
res.sendStatus(200);
|
||||
} catch (error) {
|
||||
res.status(200).json(error);
|
||||
sendServerEmail({
|
||||
subject: `Kaizen Report ${moment().format("MM-DD-YY @ HH:mm:ss")}`,
|
||||
text: `Errors: JSON.stringify(error)}
|
||||
All Errors: ${allErrors.map((e) => JSON.stringify(e, null, 2))}`
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user