Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/21/12 13:42:34 (12 years ago)
Author:
ascheibe
Message:

#1648 fetch user and client information when the optimizer starts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Access/3.3/ClientInformation.cs

    r8042 r8076  
    2222using System;
    2323using System.ServiceModel.Security;
     24using System.Threading.Tasks;
    2425
    2526namespace HeuristicLab.Clients.Access {
     
    2829    public static ClientInformation Instance {
    2930      get {
    30         if (instance == null) instance = new ClientInformation();
     31        InitializeClientInformation();
    3132        return instance;
    3233      }
     
    5455
    5556    private ClientInformation() {
    56       if (ClientInformationUtils.IsClientHeuristicLab()) {
    57         FetchClientInformationFromServer();
    58       } else {
    59         // this means we are executed by an Hive slave, therefore we just get our machine id (e.g. for OKB Algs)
    60         // because the slave has already done the registration process
    61         GenerateLocalClientConfig();
     57      if (instance == null) {
     58        if (ClientInformationUtils.IsClientHeuristicLab()) {
     59          FetchClientInformationFromServer();
     60        } else {
     61          // this means we are executed by an Hive slave, therefore we just get our machine id (e.g. for OKB Algs)
     62          // because the slave has already done the registration process
     63          GenerateLocalClientConfig();
     64        }
    6265      }
    6366    }
     
    100103      FetchClientInformationFromServer();
    101104    }
     105
     106    private static void InitializeClientInformation() {
     107      if (instance == null) instance = new ClientInformation();
     108    }
     109
     110    public static void InitializeAsync() {
     111      Task.Factory.StartNew(InitializeClientInformation);
     112    }
    102113  }
    103114}
Note: See TracChangeset for help on using the changeset viewer.