Add duration parameter in the api
This commit is contained in:
parent
2320f970c1
commit
2fae7333c0
|
@ -4732,7 +4732,7 @@ ACTOR Future<Void> addInterfaceActor( std::map<Key,std::pair<Value,ClientLeaderR
|
|||
return Void();
|
||||
}
|
||||
|
||||
ACTOR Future<int64_t> rebootWorkerActor(DatabaseContext* cx, ValueRef addr, bool check) {
|
||||
ACTOR Future<int64_t> rebootWorkerActor(DatabaseContext* cx, ValueRef addr, bool check, int duration) {
|
||||
// fetch the addresses of all workers
|
||||
state std::map<Key,std::pair<Value,ClientLeaderRegInterface>> address_interface;
|
||||
// TODO : find out when this is invalid
|
||||
|
@ -4748,13 +4748,11 @@ ACTOR Future<int64_t> rebootWorkerActor(DatabaseContext* cx, ValueRef addr, bool
|
|||
wait( waitForAll(addInterfs) );
|
||||
if (!address_interface.count(addr))
|
||||
return 0;
|
||||
if (check)
|
||||
BinaryReader::fromStringRef<ClientWorkerInterface>(addr, IncludeVersion()).reboot.send( RebootRequest(false, true));
|
||||
else
|
||||
BinaryReader::fromStringRef<ClientWorkerInterface>(addr, IncludeVersion()).reboot.send( RebootRequest());
|
||||
|
||||
BinaryReader::fromStringRef<ClientWorkerInterface>(address_interface[addr].first, IncludeVersion()).reboot.send( RebootRequest(false, check, duration));
|
||||
return 1;
|
||||
}
|
||||
|
||||
Future<int64_t> DatabaseContext::rebootWorker(StringRef addr, bool check, int duration) {
|
||||
return rebootWorkerActor(this, addr, check);
|
||||
return rebootWorkerActor(this, addr, check, duration);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue