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

Commit

Permalink
@NataliaTepluhina please add this to docs:
Browse files Browse the repository at this point in the history
Starting from Vue Storefront v1.6 now we have a special switch in `vue-storefront-api`: `config.orders.useServerQueue` which is set to `false` by default. With this option disabled the `order_2_magento` process is no longer needed as the incoming orders are directly send to Magento2. If it's set to `true` then - the old behavior of server-based Redis queued used to stack the orders first is being used
  • Loading branch information
pkarw committed Nov 21, 2018
1 parent 182f530 commit 80c497f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/api/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export default ({ config, db }) => resource({
orderProxy.create(req.body).then((result) => {
apiStatus(res, result, 200);
}).catch(err => {
console.error(err)
apiStatus(res, err, 500);
apiStatus(res, err.toString(), 500);
})
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/platform/magento2/o2m.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function isNumeric(val) {
* @param {Function} done callback - @example done(new Error()) - to acknowledge problems
*/
function processSingleOrder(orderData, config, job, done, logger = console) {

const TOTAL_STEPS = 4;
const THREAD_ID = 'ORD:' + (job ? job.id : 1) + ' - '; // job id
let currentStep = 1;
Expand Down Expand Up @@ -228,7 +227,7 @@ function processSingleOrder(orderData, config, job, done, logger = console) {
redisClient.set("order$$totals$$" + orderData.order_id, JSON.stringify(result[1]));

if(job) job.progress(currentStep++, TOTAL_STEPS);
return done(null, { magentoOrderId: result, transferedAt: new Date() });
return done(null, { magentoOrderId: result, backendOrderId: result, transferedAt: new Date() });
}).catch(err => {
logger.error('Error placing an order', err, typeof err)
if (job) job.attempts(6).backoff({ delay: 30*1000, type:'fixed' }).save()
Expand Down
1 change: 1 addition & 0 deletions src/platform/magento2/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class OrderProxy extends AbstractOrderProxy {
return new Promise ((resolve, reject) => {
try {
processSingleOrder(orderData, inst.config, null, (error, result) => {
console.log(error)
if (error) reject (error)
resolve (result)
})
Expand Down

0 comments on commit 80c497f

Please sign in to comment.