Skip to content

Commit

Permalink
Merge pull request #5378 from valadas/schedule-item-infinite-loop
Browse files Browse the repository at this point in the history
Fixed an infinite loop in schedule item.
  • Loading branch information
mitchelsellers authored Nov 8, 2022
2 parents 8133128 + 6b264db commit 8a9df5d
Showing 1 changed file with 77 additions and 1 deletion.
78 changes: 77 additions & 1 deletion DNN Platform/Library/Services/Scheduling/ScheduleItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ namespace DotNetNuke.Services.Scheduling
using DotNetNuke.Entities;
using DotNetNuke.Entities.Modules;

/// <summary>
/// Represents one item in the scheduler.
/// </summary>
[Serializable]
public class ScheduleItem : BaseEntityInfo, IHydratable
{
Expand Down Expand Up @@ -40,16 +43,34 @@ public ScheduleItem()
this.ScheduleStartDate = Null.NullDate;
}

/// <summary>
/// Gets or sets the the event this item attaches to.
/// </summary>
public string AttachToEvent { get; set; }

/// <summary>
/// Gets or sets a value indicating whether cath-up is enabled.
/// </summary>
public bool CatchUpEnabled { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the item is enabled.
/// </summary>
public bool Enabled { get; set; }

/// <summary>
/// Gets or sets the schedule start date.
/// </summary>
public DateTime ScheduleStartDate { get; set; }

/// <summary>
/// Gets or sets the friednly name for the item.
/// </summary>
public string FriendlyName { get; set; }

/// <summary>
/// Gets or sets the next start date.
/// </summary>
public virtual DateTime NextStart
{
get
Expand All @@ -64,32 +85,68 @@ public virtual DateTime NextStart

set
{
this.NextStart = value;
this.nextStart = value;
}
}

/// <summary>
/// Gets or sets the object dependencies.
/// </summary>
public string ObjectDependencies { get; set; }

/// <summary>
/// Gets or sets a value indicating how many history items to keep.
/// </summary>
public int RetainHistoryNum { get; set; }

/// <summary>
/// Gets or sets the retry time lapse value.
/// </summary>
public int RetryTimeLapse { get; set; }

/// <summary>
/// Gets or sets the unit of measure for the retry time lapse value.
/// </summary>
public string RetryTimeLapseMeasurement { get; set; }

/// <summary>
/// Gets or sets the ID of the scheduled item.
/// </summary>
public int ScheduleID { get; set; }

/// <summary>
/// Gets or sets the servers this task should run on.
/// </summary>
public string Servers { get; set; }

/// <summary>
/// Gets or sets the recurrence time lapse value.
/// </summary>
public int TimeLapse { get; set; }

/// <summary>
/// Gets or sets the unit of measure for the recurrence time lapse value.
/// </summary>
public string TimeLapseMeasurement { get; set; }

/// <summary>
/// Gets or sets the full type name.
/// </summary>
public string TypeFullName { get; set; }

/// <summary>
/// Gets or sets the process group.
/// </summary>
public int ProcessGroup { get; set; }

/// <summary>
/// Gets or sets the <see cref="ScheduleSource"/>.
/// </summary>
public ScheduleSource ScheduleSource { get; set; }

/// <summary>
/// Gets or sets the ID of the running thread.
/// </summary>
public int ThreadID { get; set; }

/// <inheritdoc/>
Expand All @@ -112,6 +169,11 @@ public virtual void Fill(IDataReader dr)
this.FillInternal(dr);
}

/// <summary>
/// Gets or sets a value indicating whether the item has object dependencies.
/// </summary>
/// <param name="strObjectDependencies">A string representing the name of the object dependencies.</param>
/// <returns>A value indicating whether the item has object dependencies.</returns>
public bool HasObjectDependencies(string strObjectDependencies)
{
if (strObjectDependencies.IndexOf(",") > -1)
Expand All @@ -135,11 +197,21 @@ public bool HasObjectDependencies(string strObjectDependencies)
return false;
}

/// <summary>
/// Adds a schedule item setting value.
/// </summary>
/// <param name="key">The setting key.</param>
/// <param name="value">The value of the setting.</param>
public void AddSetting(string key, string value)
{
this.scheduleItemSettings.Add(key, value);
}

/// <summary>
/// Gets a specific setting.
/// </summary>
/// <param name="key">The key of the setting to get.</param>
/// <returns>The value of the setting.</returns>
public virtual string GetSetting(string key)
{
if (this.scheduleItemSettings == null)
Expand All @@ -157,6 +229,10 @@ public virtual string GetSetting(string key)
}
}

/// <summary>
/// Gets all the item settings.
/// </summary>
/// <returns>An <see cref="Hashtable"/> of all the settings.</returns>
public virtual Hashtable GetSettings()
{
this.scheduleItemSettings = SchedulingProvider.Instance().GetScheduleItemSettings(this.ScheduleID);
Expand Down

0 comments on commit 8a9df5d

Please # to comment.