Feature #25: Job General Preferences
Initially to make 'long running job threshold' configurable. Updates to ManagedJobList and fix for missing GetClaimKeys method (#24).
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Disco.Data.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Data.Configuration.Modules
|
||||
{
|
||||
public class JobPreferencesConfiguration : ConfigurationBase
|
||||
{
|
||||
public JobPreferencesConfiguration(DiscoDataContext Database) : base(Database) { }
|
||||
|
||||
public override string Scope { get { return "JobPreferences"; } }
|
||||
|
||||
/// <summary>
|
||||
/// Number of days a job is open before it is considered 'Long Running'
|
||||
/// </summary>
|
||||
public int LongRunningJobDaysThreshold
|
||||
{
|
||||
get { return Get<int>(7); }
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
throw new ArgumentOutOfRangeException("value", "The Long Running Job Days Threshold cannot be less than zero");
|
||||
|
||||
Set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ namespace Disco.Data.Configuration
|
||||
this.moduleBootstrapperConfiguration = new Lazy<Modules.BootstrapperConfiguration>(() => new Modules.BootstrapperConfiguration(Database));
|
||||
this.moduleDeviceProfilesConfiguration = new Lazy<Modules.DeviceProfilesConfiguration>(() => new Modules.DeviceProfilesConfiguration(Database));
|
||||
this.moduleOrganisationAddressesConfiguration = new Lazy<Modules.OrganisationAddressesConfiguration>(() => new Modules.OrganisationAddressesConfiguration(Database));
|
||||
this.moduleJobPreferencesConfiguration = new Lazy<Modules.JobPreferencesConfiguration>(() => new Modules.JobPreferencesConfiguration(Database));
|
||||
}
|
||||
|
||||
#region Configuration Modules
|
||||
@@ -27,6 +28,7 @@ namespace Disco.Data.Configuration
|
||||
private Lazy<Modules.BootstrapperConfiguration> moduleBootstrapperConfiguration;
|
||||
private Lazy<Modules.DeviceProfilesConfiguration> moduleDeviceProfilesConfiguration;
|
||||
private Lazy<Modules.OrganisationAddressesConfiguration> moduleOrganisationAddressesConfiguration;
|
||||
private Lazy<Modules.JobPreferencesConfiguration> moduleJobPreferencesConfiguration;
|
||||
|
||||
public Modules.BootstrapperConfiguration Bootstrapper
|
||||
{
|
||||
@@ -49,6 +51,13 @@ namespace Disco.Data.Configuration
|
||||
return moduleOrganisationAddressesConfiguration.Value;
|
||||
}
|
||||
}
|
||||
public Modules.JobPreferencesConfiguration JobPreferences
|
||||
{
|
||||
get
|
||||
{
|
||||
return moduleJobPreferencesConfiguration.Value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
<Compile Include="Configuration\CommunityHelpers.cs" />
|
||||
<Compile Include="Configuration\ConfigurationBase.cs" />
|
||||
<Compile Include="Configuration\ConfigurationCache.cs" />
|
||||
<Compile Include="Configuration\Modules\JobPreferencesConfiguration.cs" />
|
||||
<Compile Include="Configuration\SystemConfiguration.cs" />
|
||||
<Compile Include="Configuration\Modules\BootstrapperConfiguration.cs" />
|
||||
<Compile Include="Configuration\Modules\DeviceProfileConfiguration.cs" />
|
||||
@@ -172,7 +173,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
Reference in New Issue
Block a user