@live-change/framework
Advanced tools
Comparing version 0.3.15 to 0.3.16
@@ -269,27 +269,29 @@ | ||
console.log(`WRITING ${rows.length} ROWS`) | ||
let operations = new Array(rows.length*2) | ||
for(let i = 0; i < rows.length; i++) { | ||
operations[i * 2] = { index: { _id: rows[i].id } } | ||
this.prepareObject(rows[i]) | ||
operations[i * 2 + 1] = rows[i] | ||
} | ||
await search.bulk({ | ||
index: this.indexName, | ||
body: operations | ||
}).then(result => { | ||
if(result.body.errors) { | ||
for(const item of result.body.items) { | ||
if(item.index && item.index.error) { | ||
console.error("ES ERROR:", item.index.error) | ||
console.error("WHEN INDEXING", rows.find(row => row.id == item.index._id)) | ||
if(rows.length > 0) { | ||
console.log(`WRITING ${rows.length} ROWS`) | ||
let operations = new Array(rows.length * 2) | ||
for(let i = 0; i < rows.length; i++) { | ||
operations[i * 2] = { index: { _id: rows[i].id } } | ||
this.prepareObject(rows[i]) | ||
operations[i * 2 + 1] = rows[i] | ||
} | ||
await search.bulk({ | ||
index: this.indexName, | ||
body: operations | ||
}).then(result => { | ||
if(result.body.errors) { | ||
for(const item of result.body.items) { | ||
if(item.index && item.index.error) { | ||
console.error("ES ERROR:", item.index.error) | ||
console.error("WHEN INDEXING", rows.find(row => row.id == item.index._id)) | ||
} | ||
} | ||
throw new Error("ES ERRORS") | ||
} | ||
throw new Error("ES ERRORS") | ||
} | ||
}).catch(error => { | ||
error = (error && error.meta && error.meta.body && error.meta.body.error) || error | ||
console.error("ES ERROR:", error) | ||
throw error | ||
}) | ||
}).catch(error => { | ||
error = (error && error.meta && error.meta.body && error.meta.body.error) || error | ||
console.error("ES ERROR:", error) | ||
throw error | ||
}) | ||
} | ||
console.log("ES INDEXED!") | ||
@@ -296,0 +298,0 @@ |
{ | ||
"name": "@live-change/framework", | ||
"version": "0.3.15", | ||
"version": "0.3.16", | ||
"description": "Live Change Framework - ultimate solution for real time mobile/web apps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122611
3398