ScheduledTasks: Renamed UserId to CustomId

This commit is contained in:
XorogVEVO 2022-02-19 19:28:59 +01:00
parent 9d0d220d8b
commit 01520e50fc
2 changed files with 4 additions and 3 deletions

View file

@ -84,7 +84,7 @@ public class InternalSheduler
public class taskInfo public class taskInfo
{ {
public string userId { get; internal set; } = ""; public string customId { get; internal set; } = "";
internal CancellationTokenSource? tokenSource { get; set; } internal CancellationTokenSource? tokenSource { get; set; }
public DateTime? runTime { get; internal set; } public DateTime? runTime { get; internal set; }
} }

View file

@ -197,7 +197,8 @@ public static class UniversalExtensions
/// <param name="task">The task to run</param> /// <param name="task">The task to run</param>
/// <param name="runTime">The time to run the task</param> /// <param name="runTime">The time to run the task</param>
/// <returns>An unique identifier of the task</returns> /// <returns>An unique identifier of the task</returns>
public static string CreateScheduleTask(this Task task, DateTime runTime, string UserId = "")
public static string CreateScheduleTask(this Task task, DateTime runTime, string CustomId = "")
{ {
string UID = Guid.NewGuid().ToString(); string UID = Guid.NewGuid().ToString();
CancellationTokenSource CancellationToken = new CancellationTokenSource(); CancellationTokenSource CancellationToken = new CancellationTokenSource();
@ -214,7 +215,7 @@ public static class UniversalExtensions
task.Start(); task.Start();
}); });
registeredScheduledTasks.Add(UID, new taskInfo { tokenSource = CancellationToken, userId = UserId, runTime = runTime}); registeredScheduledTasks.Add(UID, new taskInfo { tokenSource = CancellationToken, customId = CustomId, runTime = runTime});
return UID; return UID;
} }