Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/29/13 08:16:09 (11 years ago)
Author:
fschoepp
Message:

#1888:

  • Removed unnecessary files from web project.
  • Cleaned up slave.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.Clients.Hive.Slave.AzureClient/3.3/WorkerRole.cs

    r9508 r9549  
    2929using Microsoft.WindowsAzure.StorageClient;
    3030using System.Text;
     31using System.Diagnostics;
    3132
    3233namespace HeuristicLab.Clients.Hive.Slave.AzureClient {
     
    4243    public override void Run() {
    4344      try {
    44         LogError(new Exception("Starting Run()..."));
     45        Trace.WriteLine("Starting Run()...");
    4546        core = new HeuristicLab.Clients.Hive.SlaveCore.Core(false);
    4647
     
    6061        });
    6162
    62         LogError(new Exception("Run(): Core started successfullly"));
     63        Trace.WriteLine("Run(): Core started successfullly");
    6364        while (true) {
    6465          Thread.Sleep(10000);
     
    6667      }
    6768      catch (Exception e) {
    68         LogError(e);
    69     throw e;
     69        Trace.WriteLine(e.ToString());
     70        throw e;
    7071      }
    7172    }
     
    7576        ServicePointManager.DefaultConnectionLimit = 12;
    7677        //core = new Core();
    77         LogError(new Exception("Running OnStart()"));
     78        Trace.WriteLine("Running OnStart()");
    7879        try {
    7980          if (!String.IsNullOrEmpty(RoleEnvironment.GetConfigurationSettingValue(Constants.DiagnosticsConnectionString))) {
     
    8889          // -> diagnostics disabled
    8990          // nothing more to do
    90           LogError(ex);
     91          Trace.WriteLine(ex.ToString());
    9192        }
    9293
    9394        RoleEnvironment.Changed += RoleEnvironmentChanged;
    94         LogError(new Exception("Finished OnStart() successfullly"));
     95        Trace.WriteLine("Finished OnStart() successfullly");
    9596      }
    9697      catch (Exception ex) {
    97         LogError(ex);
    98     throw ex;
     98        Trace.WriteLine(ex.ToString());
     99        throw ex;
    99100      }
    100101      return base.OnStart();
    101     }
    102 
    103     private void LogError(Exception e) {
    104       var storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(Constants.DiagnosticsConnectionString));
    105       var blobClient = storageAccount.CreateCloudBlobClient();
    106       var container = blobClient.GetContainerReference("slavelog");
    107       container.CreateIfNotExist();
    108       var guid = Guid.NewGuid();
    109       var blob = container.GetBlobReference(guid.ToString());
    110       var builder = new StringBuilder();
    111       builder.Append("ToString: ").Append(e.ToString()).Append("\n");
    112       builder.Append("Message: ").Append(e.Message).Append("\n");
    113       blob.UploadText(builder.ToString());
    114102    }
    115103
Note: See TracChangeset for help on using the changeset viewer.