From 7d426b54b5ca3dbbdcf7659b85417cbc3bba07ab Mon Sep 17 00:00:00 2001 From: Razvan Botea Date: Wed, 27 Apr 2016 16:09:20 +0300 Subject: [PATCH] added retry on conflicts when updating objects --- lib/database/elasticsearch_adapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/database/elasticsearch_adapter.js b/lib/database/elasticsearch_adapter.js index f06702b..68d117e 100644 --- a/lib/database/elasticsearch_adapter.js +++ b/lib/database/elasticsearch_adapter.js @@ -391,7 +391,7 @@ ElasticSearchDB.prototype.updateObjects = function(patches, callback) { 'def parsed = jsonSlurper.parseText(\''+JSON.stringify(dbObjects[id])+'\');'+ 'ctx._source = parsed;'; - bulk.push({update: {_type: objectModel, _id: id}}); + bulk.push({update: {_type: objectModel, _id: id, _retry_on_conflict: 10}}); bulk.push({script: script}); c(); }, function() {