Files
duplicati/Duplicati/Library/Main/Operation/Restore/VolumeDecrypter.cs
T

35 lines
925 B
C#

using System;
using System.Threading.Tasks;
using CoCoL;
namespace Duplicati.Library.Main.Operation.Restore
{
internal class VolumeDecrypter
{
public static Task Run()
{
return AutomationExtensions.RunTask(
new
{
Input = Channels.downloadedVolume.ForRead,
Output = Channels.decryptedVolume.ForWrite
},
async self =>
{
try
{
while (true)
{
var (block_request, volume) = await self.Input.ReadAsync();
var f = volume.Wait();
await self.Output.WriteAsync((block_request, f));
}
}
catch (RetiredException ex)
{
// NOP
}
});
}
}
}