protected override void Dequeue() { CandidateFile candidate; if (queue.TryDequeue(out candidate)) { try { var stopWatch = new Stopwatch(); stopWatch.Start(); var exifData = ExifProvider.Get(basePath, candidate.FullFilename); stopWatch.Stop(); if (stopWatch.Elapsed.TotalMilliseconds > 50) { logger.Error("GetExif for {0} took {1} msecs", candidate.FullFilename, stopWatch.Elapsed.TotalMilliseconds); } if (exifData == null) logger.Error("ExifData is null for {0}", candidate.FullFilename); var media = new Media { Path = candidate.AliasedPath, Signature = candidate.Signature, LengthInBytes = candidate.LengthInBytes, Filename = Path.GetFileName(candidate.FullFilename) }; enqueueIndex(media); } catch (Exception e) { logger.Error("Exception preparing {0}: {1}", candidate.FullFilename, e); } } else { Thread.Sleep(0); } }
public void Enqueue(Media media) { queue.Enqueue(media); }