IO-233 Update ARMS trigger & error logging.

This commit is contained in:
Patrick Fic
2022-09-19 10:53:48 -07:00
parent 3d9a24de4f
commit 2042ded99b
2 changed files with 3 additions and 4 deletions

View File

@@ -42,8 +42,8 @@ function pollFunc(fn, timeout, interval) {
pollFunc(getEntegralShopData, 0, 5 * 60 * 1000); //Set the metadata to refresh every 5 minutes.
async function getEntegralShopData() {
const { bodyshops } = await client.request(queries.GET_ENTEGRAL_SHOPS);
await storage.init({ logging: true });
const { bodyshops } = await client.request(queries.GET_ENTEGRAL_SHOPS);
logger.log("set-entegral-shops-local-storage", "DEBUG", "API", null, null);
await storage.setItem("entegralShops", bodyshops);
return true; //Continue execution.
@@ -872,6 +872,7 @@ exports.default = async (req, res) => {
} catch (error) {
logger.log("arms-failed-job", "ERROR", "api", job.shopid, {
job: JSON.stringify({ id: job.id, ro_number: job.ro_number }),
error: JSON.stringify(error),
});
}