using System.Linq;
using System.Net;
using System.Threading.Tasks;
+using Castle.ActiveRecord;
using Pithos.Interfaces;
using Pithos.Network;
using log4net;
private Agent<CloudDeleteAction> _deleteAgent;
- [Import]
+ [System.ComponentModel.Composition.Import]
public IStatusKeeper StatusKeeper { get; set; }
public IStatusNotification StatusNotification { get; set; }
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;
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
{