예제 #1
0
 public bool GenerateThumbnails()
 {
     try
     {
         if (!this.failed)
         {
             Directory.CreateDirectory(this.workingDirectory);
             log.Debug("Generating thumbnails for job: " + this.jobToken);
             thumbGenerator = new ThumbnailGenerator(this.JobToken, this.workingDirectory, download);
             this.status    = "Working";
             taskSet.EnqueSimpleTask(thumbGenerator);
             return(true);
         }
     }
     catch (Exception ex)
     {
         log.Error("An error occured GenerateThumbnails: " + this.jobToken, ex);
     }
     return(false);
 }
예제 #2
0
 public void CleanUp()
 {
     try
     {
         DirectoryInfo di = new DirectoryInfo(this.workingDirectory);
         foreach (var file in di.GetFiles())
         {
             file.Delete();
         }
         di.Delete();
         this.passes.Clear();
         this.taskSet        = null;
         this.download       = null;
         this.thumbGenerator = null;
         this.callbackUrl    = null;
         this.cleaned        = true;
     }
     catch (Exception ex)
     {
         log.Error("Failed to cleanup working directory", ex);
     }
 }
예제 #3
0
        public bool GenerateThumbnails()
        {
            try
            {
                if (!this.failed)
                {

                    Directory.CreateDirectory(this.workingDirectory);
                    log.Debug("Generating thumbnails for job: " + this.jobToken);
                    thumbGenerator = new ThumbnailGenerator(this.JobToken, this.workingDirectory, download);
                    this.status = "Working";
                    taskSet.EnqueSimpleTask(thumbGenerator);
                    return true;
                }
            }
            catch (Exception ex)
            {
                log.Error("An error occured GenerateThumbnails: " + this.jobToken, ex);
            }
            return false;
        }
예제 #4
0
 public void CleanUp()
 {
     try
     {
         DirectoryInfo di = new DirectoryInfo(this.workingDirectory);
         foreach (var file in di.GetFiles())
         {
             file.Delete();
         }
         di.Delete();
         this.passes.Clear();
         this.taskSet = null;
         this.download = null;
         this.thumbGenerator = null;
         this.callbackUrl = null;
         this.cleaned = true;
     }
     catch (Exception ex)
     {
         log.Error("Failed to cleanup working directory", ex);
     }
 }