All Find*() repository methods getting too slow

Hi Robert Wagner,

I am using below methods which retrieves large data but it is too slow. I read some where in your discussion that it is might be because of Find*() methods. Could you please let me know the alternatives for below methods. Combinely my code is taking 15 minutes to responds as i have used these many times. Please help me out here-

var validDeployments = repository.Deployments.FindMany(p => machineIDList.Any(p2 => p2 == p.SpecificMachineIds.ToString()));
var test2 = repository.ServerStatus.GetServerStatus();

Even if i give some lambda expression inside findMany() as i need several items it is really getting slow. Please let me know if you need any extra inputs on same.



Adding one more method-

tempStateData.State = (repository.Tasks.Get(repository.Deployments.FindOne(
x => (x.SpecificMachineIds.Contains(_machineID))).TaskId).State).ToString();

This one is to get the current State of machine.


Hi Pratik,

Thanks for getting in touch.

The find methods executed by Octopus Client do the filtering client side. So when you run repository.Deployments.FindMany all deployments will be retrieved from the Server and then filtered.

An alternative might be to get all deployments once and then do your own filtering on it.