mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-28 12:37:48 +01:00
Server: try downloading from all if we have a dummy object
just speeds up sync a little
This commit is contained in:
@@ -46,6 +46,8 @@ public class RemoteObjectServiceClient {
|
||||
ProtoSerializer<OpP, Op> opProtoSerializer;
|
||||
@Inject
|
||||
ProtoSerializer<GetObjectReply, ReceivedObject> receivedObjectProtoSerializer;
|
||||
@Inject
|
||||
PeerManager peerManager;
|
||||
|
||||
public Pair<PeerId, ReceivedObject> getSpecificObject(JObjectKey key, PeerId peerId) {
|
||||
return rpcClientFactory.withObjSyncClient(peerId, (peer, client) -> {
|
||||
@@ -63,7 +65,9 @@ public class RemoteObjectServiceClient {
|
||||
}
|
||||
|
||||
var targetVersion = objMeta.versionSum();
|
||||
var targets = objMeta.knownRemoteVersions().entrySet().stream()
|
||||
var targets = objMeta.knownRemoteVersions().isEmpty()
|
||||
? peerManager.getAvailableHosts()
|
||||
: objMeta.knownRemoteVersions().entrySet().stream()
|
||||
.filter(entry -> entry.getValue().equals(targetVersion))
|
||||
.map(Map.Entry::getKey).toList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user