mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 22:17:22 +01:00
Download rework (#22)
* rework server to send download ready back via signalr * adjust queue handling for removal * adjust api to main Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
parent
5e0e21ef68
commit
4bd71a5889
15 changed files with 165 additions and 87 deletions
|
|
@ -35,25 +35,43 @@ public class RequestFileStreamResult : FileStreamResult
|
|||
|
||||
public override void ExecuteResult(ActionContext context)
|
||||
{
|
||||
base.ExecuteResult(context);
|
||||
try
|
||||
{
|
||||
base.ExecuteResult(context);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_releaseCts.Cancel();
|
||||
|
||||
_releaseCts.Cancel();
|
||||
if (!_releasedSlot)
|
||||
_requestQueueService.FinishRequest(_requestId);
|
||||
|
||||
if (!_releasedSlot)
|
||||
_requestQueueService.FinishRequest(_requestId);
|
||||
|
||||
_mareMetrics.DecGauge(MetricsAPI.GaugeCurrentDownloads);
|
||||
_mareMetrics.DecGauge(MetricsAPI.GaugeCurrentDownloads);
|
||||
}
|
||||
}
|
||||
|
||||
public override async Task ExecuteResultAsync(ActionContext context)
|
||||
{
|
||||
await base.ExecuteResultAsync(context).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
await base.ExecuteResultAsync(context).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_releaseCts.Cancel();
|
||||
|
||||
_releaseCts.Cancel();
|
||||
if (!_releasedSlot)
|
||||
_requestQueueService.FinishRequest(_requestId);
|
||||
|
||||
if (!_releasedSlot)
|
||||
_requestQueueService.FinishRequest(_requestId);
|
||||
|
||||
_mareMetrics.DecGauge(MetricsAPI.GaugeCurrentDownloads);
|
||||
_mareMetrics.DecGauge(MetricsAPI.GaugeCurrentDownloads);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue