You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to modify the attribute.mapToVS to work on global/shared attributes hash
Attribute values are populated by each process/product import - so if the state weren't shared it would have been easily desynchronized. Right now because we don't support multiprocess it's pretty straightforward: using a local hash.
Here is the function to be modified with some notes on the possible solutions:
\
functionmapToVS(attributeCode,attributeType,attributeValue){letattr=attrHash[attributeCode]if(!attr){attr=attributeTemplate(attributeCode,attributeType)attr.id=maxAttrIdattr.attribute_id=maxAttrIdattrHash[attributeCode]=attrmaxAttrId++}if(attr.frontend_input=='select'){letexistingOption=attr.options.find((option)=>{returnoption.label==attributeValue})if(!existingOption){letlastOption=attr.options.length>0 ? attr.options[attr.options.length-1] : null// we can use memored or elastic search to store each option per each attribute separately - to keep the same indexes between processes for example key would be: $attribute_code$$attribute_value = 14 // OR SEND MODIFIED attributes to the workers each time attrHash changes: https://nodejs.org/api/cluster.html#cluster_cluster_workersletoptIndex=1if(lastOption){optIndex=lastOption.value+1}attr.options.push({label: attributeValue,value: optIndex})returnoptIndex}else{returnexistingOption.value// non select attrs}}else{returnattributeValue// we're fine here for decimal and varchar attributes}}
The text was updated successfully, but these errors were encountered:
We need to modify the
attribute.mapToVS
to work on global/shared attributes hashAttribute values are populated by each process/product import - so if the state weren't shared it would have been easily desynchronized. Right now because we don't support multiprocess it's pretty straightforward: using a local hash.
Here is the function to be modified with some notes on the possible solutions:
\
The text was updated successfully, but these errors were encountered: