Ignore:
Timestamp:
05/08/09 14:55:56 (13 years ago)
Author:
kgrading
Message:

fixed small changes in logging, messagequeues and the jobfetching (#467)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Core/3.2/JobStorage/JobStorageManager.cs

    r1728 r1775  
    99using HeuristicLab.Hive.Contracts;
    1010using System.Xml.Serialization;
     11using System.Diagnostics;
    1112
    1213namespace HeuristicLab.Hive.Client.Core.JobStorage {
     
    1617    //Todo: execution path
    1718    //Todo: Choose a better directory name
    18     private static String path = "C:\\Program Files\\HeuristicLab 3.0\\plugins\\jobStorrage\\";
     19    private static String path = "C:\\Program Files\\HeuristicLab 3.0\\plugins\\Hive.Client.Jobs\\";
    1920   
    2021    public static void PersistObjectToDisc(String serverIP, long serverPort, Guid jobId, byte[] job) {
     
    3031        jobstream.Write(job, 0, job.Length);
    3132        storedJobsList.Add(info);
    32         Logging.Instance.Info("JobStorageManager", "Job " + info.JobID + " stored on the harddisc");
     33        Debug.WriteLine("Job " + info.JobID + " stored on the harddisc");
     34        //Logging.Instance.Info("JobStorageManager", "Job " + info.JobID + " stored on the harddisc");
    3335      }
    3436      catch (Exception e) {
     
    4850        if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin && (storedJobsList[index-1].ServerIP == WcfService.Instance.ServerIP && storedJobsList[index-1].ServerPort == WcfService.Instance.ServerPort)) {
    4951          String filename = storedJobsList[index-1].ServerIP + "." + storedJobsList[index-1].ServerPort + "." + storedJobsList[index-1].JobID.ToString();
    50           Logging.Instance.Info("JobStorrageManager", "Sending stored job " + storedJobsList[index - 1].JobID + " to the server");
     52          Debug.WriteLine("Sending stored job " + storedJobsList[index - 1].JobID + " to the server");
     53          //Logging.Instance.Info("JobStorrageManager", "Sending stored job " + storedJobsList[index - 1].JobID + " to the server");
    5154          byte[] job = File.ReadAllBytes(path + filename + ".dat");
    5255         
    5356          //Todo: ask server first if he really wants the job...
    5457          ResponseResultReceived res = WcfService.Instance.SendStoredJobResultsSync(ConfigManager.Instance.GetClientInfo().Id, storedJobsList[index-1].JobID, job, 1.00, null, true);
     58          ClientStatusInfo.JobsProcessed++;
    5559          //TODO: has to be fixed from server side
    5660          //if (res.Success == true) {
    57           Logging.Instance.Info("JobStorrageManager", "Sending of job " + storedJobsList[index - 1].JobID + " done"); 
     61          Debug.WriteLine("Sending of job " + storedJobsList[index - 1].JobID + " done"); 
     62          //Logging.Instance.Info("JobStorrageManager", "Sending of job " + storedJobsList[index - 1].JobID + " done"); 
     63
    5864          storedJobsList.Remove(storedJobsList[index - 1]);
    5965          File.Delete(path + filename + ".dat");
     
    6672    public static void StoreJobList() {
    6773      XmlSerializer serializer = new XmlSerializer(typeof(List<JobStorageInfo>));
    68       TextWriter writer = new StreamWriter(path + "list.xml");
     74      TextWriter writer = new StreamWriter(Path.Combine(path ,"list.xml"));
    6975      serializer.Serialize(writer, storedJobsList);
     76      writer.Close();
    7077    }
    7178   
Note: See TracChangeset for help on using the changeset viewer.