Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6546


Ignore:
Timestamp:
07/08/11 00:36:56 (13 years ago)
Author:
ascheibe
Message:

#1233
Don't call Clear() on ThreadSafeLog in log_MessageAdded.
This doesn't work with the changes made in r6536 (LockRecursionPolicy.SupportsRecursion).
Instead use maxLogCount of Core.Log to limit the number of log messages kept in memory.

Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r6464 r6546  
    2525using System.Threading;
    2626using System.Threading.Tasks;
     27using HeuristicLab.Clients.Hive.SlaveCore.Properties;
    2728using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;
    2829using HeuristicLab.Common;
     
    5354
    5455    public Core() {
    55       var log = new ThreadSafeLog(new Log());
     56      var log = new ThreadSafeLog(new Log(Settings.Default.MaxLogCount));
    5657      this.pluginManager = new PluginManager(WcfService.Instance, log);
    5758      this.jobManager = new JobManager(pluginManager, log);
     
    408409    private void log_MessageAdded(object sender, EventArgs<string> e) {
    409410      clientCom.LogMessage(e.Value.Split('\t')[1]);
    410       ((ILog)sender).Clear(); // don't let the log take up memory
    411411    }
    412412    #endregion
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Properties/Settings.Designer.cs

    r6464 r6546  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.225
     4//     Runtime Version:4.0.30319.235
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    275275            }
    276276        }
     277       
     278        [global::System.Configuration.UserScopedSettingAttribute()]
     279        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     280        [global::System.Configuration.DefaultSettingValueAttribute("1")]
     281        public int MaxLogCount {
     282            get {
     283                return ((int)(this["MaxLogCount"]));
     284            }
     285            set {
     286                this["MaxLogCount"] = value;
     287            }
     288        }
    277289    }
    278290}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Properties/Settings.settings

    r6464 r6546  
    6666      <Value Profile="(Default)">hiveslave</Value>
    6767    </Setting>
     68    <Setting Name="MaxLogCount" Type="System.Int32" Scope="User">
     69      <Value Profile="(Default)">1</Value>
     70    </Setting>
    6871  </Settings>
    6972</SettingsFile>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app_ascheibe.config

    r6464 r6546  
    7575        <value>hiveslave</value>
    7676      </setting>
     77      <setting name="MaxLogCount" serializeAs="String">
     78        <value>1</value>
     79      </setting>
    7780    </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings>
    7881  </userSettings>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app_f005pc.config

    r6464 r6546  
    7575        <value>hiveslave</value>
    7676      </setting>
     77      <setting name="MaxLogCount" serializeAs="String">
     78        <value>1</value>
     79      </setting>
    7780    </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings>
    7881  </userSettings>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app_services.config

    r6464 r6546  
    7575        <value>hiveslave</value>
    7676      </setting>
     77      <setting name="MaxLogCount" serializeAs="String">
     78        <value>1</value>
     79      </setting>
    7780    </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings>
    7881  </userSettings>
Note: See TracChangeset for help on using the changeset viewer.