Changeset 8076 for trunk/sources/HeuristicLab.Clients.Access
- Timestamp:
- 06/21/12 13:42:34 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.Access/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Access/3.3/ClientInformation.cs
r8042 r8076 22 22 using System; 23 23 using System.ServiceModel.Security; 24 using System.Threading.Tasks; 24 25 25 26 namespace HeuristicLab.Clients.Access { … … 28 29 public static ClientInformation Instance { 29 30 get { 30 if (instance == null) instance = newClientInformation();31 InitializeClientInformation(); 31 32 return instance; 32 33 } … … 54 55 55 56 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 } 62 65 } 63 66 } … … 100 103 FetchClientInformationFromServer(); 101 104 } 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 } 102 113 } 103 114 } -
trunk/sources/HeuristicLab.Clients.Access/3.3/UserInformation.cs
r8043 r8076 22 22 using System; 23 23 using System.ServiceModel.Security; 24 using System.Threading.Tasks; 24 25 25 26 namespace HeuristicLab.Clients.Access { … … 30 31 public static UserInformation Instance { 31 32 get { 32 if (instance == null) instance = newUserInformation();33 InitializeUserInformation(); 33 34 return instance; 34 35 } … … 61 62 62 63 private UserInformation() { 63 //this blocks, so there should be anywhere in the Optimizer startup process64 //a call to FetchUserInformationFromServerAsync which is non-blocking65 FetchUserInformationFromServer();64 if (instance == null) { 65 FetchUserInformationFromServer(); 66 } 66 67 } 67 68 68 69 69 private void FetchUserInformationFromServer() { … … 92 92 FetchUserInformationFromServer(); 93 93 } 94 95 private static void InitializeUserInformation() { 96 if (instance == null) instance = new UserInformation(); 97 } 98 99 public static void InitializeAsync() { 100 Task.Factory.StartNew(InitializeUserInformation); 101 } 94 102 } 95 103 }
Note: See TracChangeset
for help on using the changeset viewer.