mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
update text
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.Common.ScheduledTasks
|
||||
{
|
||||
@@ -35,7 +37,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="lastResult">The last result.</param>
|
||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||
public void Start(TaskResult lastResult, bool isApplicationStartup)
|
||||
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||
{
|
||||
DisposeTimer();
|
||||
|
||||
@@ -44,7 +46,11 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
var triggerDate = now.TimeOfDay > TimeOfDay ? now.Date.AddDays(1) : now.Date;
|
||||
triggerDate = triggerDate.Add(TimeOfDay);
|
||||
|
||||
Timer = new Timer(state => OnTriggered(), null, triggerDate - now, TimeSpan.FromMilliseconds(-1));
|
||||
var dueTime = triggerDate - now;
|
||||
|
||||
logger.Info("Daily trigger for {0} set to fire at {1}, which is {2} minutes from now.", taskName, triggerDate.ToString(), dueTime.TotalMinutes.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
Timer = new Timer(state => OnTriggered(), null, dueTime, TimeSpan.FromMilliseconds(-1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using System;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.Common.ScheduledTasks
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="lastResult">The last result.</param>
|
||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||
void Start(TaskResult lastResult, bool isApplicationStartup);
|
||||
void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup);
|
||||
|
||||
/// <summary>
|
||||
/// Stops waiting for the trigger action
|
||||
|
||||
@@ -3,6 +3,7 @@ using MediaBrowser.Model.Tasks;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.Common.ScheduledTasks
|
||||
{
|
||||
@@ -38,7 +39,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="lastResult">The last result.</param>
|
||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||
public void Start(TaskResult lastResult, bool isApplicationStartup)
|
||||
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||
{
|
||||
DisposeTimer();
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.Common.ScheduledTasks
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="lastResult">The last result.</param>
|
||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||
public async void Start(TaskResult lastResult, bool isApplicationStartup)
|
||||
public async void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||
{
|
||||
if (isApplicationStartup)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using MediaBrowser.Model.Tasks;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.Common.ScheduledTasks
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="lastResult">The last result.</param>
|
||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||
public void Start(TaskResult lastResult, bool isApplicationStartup)
|
||||
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||
{
|
||||
switch (SystemEvent)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Common.ScheduledTasks
|
||||
@@ -41,7 +42,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// </summary>
|
||||
/// <param name="lastResult">The last result.</param>
|
||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||
public void Start(TaskResult lastResult, bool isApplicationStartup)
|
||||
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
|
||||
{
|
||||
DisposeTimer();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user