Revision 2e3aee00 trunk/Pithos.Core/Agents/WorkflowAgent.cs

b/trunk/Pithos.Core/Agents/WorkflowAgent.cs
206 206
        public void RestartInterruptedFiles(AccountInfo accountInfo)
207 207
        {
208 208
            
209
            StatusNotification.NotifyChange("Restart processing interrupted files", TraceLevel.Verbose);
210 209

  
211 210
            using (log4net.ThreadContext.Stacks["Workflow"].Push("Restart"))
212 211
            {
......
219 218

  
220 219

  
221 220
                var account = accountInfo;
222
                var pendingEntries = from state in FileState.Queryable
221
                var pendingEntries = (from state in FileState.Queryable
223 222
                                     where state.FileStatus != FileStatus.Unchanged &&
224 223
                                           !state.FilePath.StartsWith(cachePath) &&
225 224
                                           !state.FilePath.EndsWith(".ignore") &&
226 225
                                           state.FilePath.StartsWith(account.AccountPath)
227
                                     select state;
228
                var pendingStates = new List<WorkflowState>();
229
                foreach (var state in pendingEntries)
230
                {
231
                        pendingStates.Add(new WorkflowState(account, state));
232
                }
226
                                     select state).ToList();
227
                if (pendingEntries.Count>0)
228
                    StatusNotification.NotifyChange("Restart processing interrupted files", TraceLevel.Verbose);
229

  
230
                var pendingStates = pendingEntries
231
                    .Select(state => new WorkflowState(account, state))
232
                    .ToList();
233

  
233 234
                if (Log.IsDebugEnabled)
234 235
                    Log.DebugFormat("Found {0} interrupted files", pendingStates.Count);
235 236

  
236

  
237
                foreach (var entry in pendingStates)
238
                {
239
                       Post(entry);
240
                }
237
                pendingStates.ForEach(Post);
241 238
            }
242 239
        }
243 240

  

Also available in: Unified diff