mirror of https://gitee.com/bigwinds/arangodb
Hand on --force option of arangorestore.
This commit is contained in:
parent
7865ac6e76
commit
4e95044faa
|
@ -2676,6 +2676,17 @@ void RestReplicationHandler::handleCommandRestoreDataCoordinator () {
|
||||||
ClusterCommResult* result;
|
ClusterCommResult* result;
|
||||||
CoordTransactionID coordTransactionID = TRI_NewTickServer();
|
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) {
|
for (it = shardIdsMap.begin(); it != shardIdsMap.end(); ++it) {
|
||||||
map<string, string>* headers = new map<string, string>;
|
map<string, string>* headers = new map<string, string>;
|
||||||
it2 = shardTab.find(it->first);
|
it2 = shardTab.find(it->first);
|
||||||
|
@ -2689,7 +2700,7 @@ void RestReplicationHandler::handleCommandRestoreDataCoordinator () {
|
||||||
triagens::rest::HttpRequest::HTTP_REQUEST_PUT,
|
triagens::rest::HttpRequest::HTTP_REQUEST_PUT,
|
||||||
"/_db/" + StringUtils::urlEncode(dbName) +
|
"/_db/" + StringUtils::urlEncode(dbName) +
|
||||||
"/_api/replication/restore-data?collection=" +
|
"/_api/replication/restore-data?collection=" +
|
||||||
it->first,
|
it->first + forceopt,
|
||||||
new string(bufs[j]->c_str(), bufs[j]->length()),
|
new string(bufs[j]->c_str(), bufs[j]->length()),
|
||||||
true, headers, NULL, 300.0);
|
true, headers, NULL, 300.0);
|
||||||
delete result;
|
delete result;
|
||||||
|
|
Loading…
Reference in New Issue