ScheduledTasks: Renamed UserId to CustomId
This commit is contained in:
parent
9d0d220d8b
commit
01520e50fc
2 changed files with 4 additions and 3 deletions
|
|
@ -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; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue