-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional redirect to proxy #85
Comments
That should work just fine. Does it not work? |
No, it doesn't work. I tried to specify
VS Console -
API - |
Can you try? public async void StopJob(long id)
{
var job= await _jobService.getJobAsync(id);
if (job == null)
{
return Task.FromResult(Logger.Error($"No worker found"));
}
string workerUrl = $"{job.worker_url}/jobs/{id}/stop";
return await this.HttpProxyAsync(workerUrl);
} |
No that causes build errors - |
It only work when |
Sorry, I meant this. public async void StopJob(long id)
{
var job= await _jobService.getJobAsync(id);
if (job == null)
{
return Task.FromResult(Logger.Error($"No worker found"));
}
string workerUrl = $"{job.worker_url}/jobs/{id}/stop";
await this.HttpProxyAsync(workerUrl);
} |
Ok, I will need to try to repro. Any chance you could add a test that repros your issue? |
the only way I found is to have two downstream APIs and by condition direct the traffic to one of them [HttpPost]
[Route("orders")]
public Task GetOrders()
{
var newServiceEnabled = getNewServiceEnabledAsync().Result;
if (newServiceEnabled)
{
return this.HttpProxyAsync("https://new-service.com/orders", _proxyOptions);
}
return this.HttpProxyAsync("https://old-service.com/orders", _proxyOptions);
} |
I want to check some conditions on DB, before making a redirect to proxy. Any suggestion on code below.
All, I need is get the worker URL from database using
getJobAsync()
function before making a request to proxy..Because there may be 100s of running workers and I need to use the specific worker URL to proxy from the API.The text was updated successfully, but these errors were encountered: