X-Git-Url: https://code.grnet.gr/git/pithos-ms-client/blobdiff_plain/44b979b6d2a93c698aa7c1d99fe9a4c27f29a345..e81dd1f6fd93a8c094dff04db580385029fc8ee4:/trunk/Pithos.Core/Agents/NetworkAgent.cs diff --git a/trunk/Pithos.Core/Agents/NetworkAgent.cs b/trunk/Pithos.Core/Agents/NetworkAgent.cs index 940c9f4..8c4792c 100644 --- a/trunk/Pithos.Core/Agents/NetworkAgent.cs +++ b/trunk/Pithos.Core/Agents/NetworkAgent.cs @@ -45,6 +45,7 @@ using System.IO; using System.Linq; using System.Net; using System.Threading.Tasks; +using Castle.ActiveRecord; using Pithos.Interfaces; using Pithos.Network; using log4net; @@ -61,7 +62,7 @@ namespace Pithos.Core.Agents private Agent _deleteAgent; - [Import] + [System.ComponentModel.Composition.Import] public IStatusKeeper StatusKeeper { get; set; } public IStatusNotification StatusNotification { get; set; } @@ -352,7 +353,7 @@ namespace Pithos.Core.Agents Contract.EndContractBlock(); //If the action targets a local file, add a treehash calculation - if (cloudAction.LocalFile as FileInfo != null) + if (!(cloudAction is CloudDeleteAction) && cloudAction.LocalFile as FileInfo != null) { var accountInfo = cloudAction.AccountInfo; var localFile = (FileInfo) cloudAction.LocalFile; @@ -548,12 +549,15 @@ namespace Pithos.Core.Agents var localFile = fileAgent.GetFileSystemInfo(relativePath); if (objectInfo.Content_Type == @"application/directory" && localFile is DirectoryInfo) continue; - var state = FileState.FindByFilePath(localFile.FullName); - //Common files should be checked on a per-case basis to detect differences, which is newer + using (new SessionScope(FlushAction.Never)) + { + var state = FileState.FindByFilePath(localFile.FullName); + //Common files should be checked on a per-case basis to detect differences, which is newer - yield return new CloudAction(accountInfo,CloudActionType.MustSynch, - localFile, objectInfo, state, accountInfo.BlockSize, - accountInfo.BlockHash); + yield return new CloudAction(accountInfo, CloudActionType.MustSynch, + localFile, objectInfo, state, accountInfo.BlockSize, + accountInfo.BlockHash); + } } else {