readonly ConcurrentDictionary<string,DateTime> _deletedFiles=new ConcurrentDictionary<string, DateTime>();
- private readonly AutoResetEvent _pauseAgent = new AutoResetEvent(false);
+ private readonly ManualResetEventSlim _pauseAgent = new ManualResetEventSlim(true);
[System.ComponentModel.Composition.Import]
public IStatusKeeper StatusKeeper { get; set; }
Action loop = null;
loop = () =>
{
- _pauseAgent.WaitOne();
+ _pauseAgent.Wait();
var message = inbox.Receive();
var process=message.Then(Process,inbox.CancellationToken);
inbox.LoopAsync(process, loop);
}
finally
{
+ //Set the event when all delete actions are processed
if (_deleteAgent.InputCount == 0)
_pauseAgent.Set();
using (log4net.ThreadContext.Stacks["Retrieve Remote"].Push(accountInfo.UserName))
{
+ _pauseAgent.Wait();
+
Log.Info("Scheduled");
var client=new CloudFilesClient(accountInfo);
var containers = client.ListContainers(accountInfo.UserName);
-
+
+
CreateContainerFolders(accountInfo, containers);
try