From 4e95044faa4f9dbccabe51ddbe59b0879b256b08 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Thu, 10 Jul 2014 14:34:21 +0200 Subject: [PATCH] Hand on --force option of arangorestore. --- arangod/RestHandler/RestReplicationHandler.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arangod/RestHandler/RestReplicationHandler.cpp b/arangod/RestHandler/RestReplicationHandler.cpp index 95d8a5cb0f..2003be5f14 100644 --- a/arangod/RestHandler/RestReplicationHandler.cpp +++ b/arangod/RestHandler/RestReplicationHandler.cpp @@ -2676,6 +2676,17 @@ void RestReplicationHandler::handleCommandRestoreDataCoordinator () { ClusterCommResult* result; CoordTransactionID coordTransactionID = TRI_NewTickServer(); + bool force = false; + char const* value; + string forceopt; + value = _request->value("force"); + if (value != nullptr) { + force = StringUtils::boolean(value); + if (force) { + forceopt = "&force=true"; + } + } + for (it = shardIdsMap.begin(); it != shardIdsMap.end(); ++it) { map* headers = new map; it2 = shardTab.find(it->first); @@ -2689,7 +2700,7 @@ void RestReplicationHandler::handleCommandRestoreDataCoordinator () { triagens::rest::HttpRequest::HTTP_REQUEST_PUT, "/_db/" + StringUtils::urlEncode(dbName) + "/_api/replication/restore-data?collection=" + - it->first, + it->first + forceopt, new string(bufs[j]->c_str(), bufs[j]->length()), true, headers, NULL, 300.0); delete result;