mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
add null check to PeriodicTimer
This commit is contained in:
parent
cfa8f6c6ec
commit
352595bc16
@ -14,6 +14,11 @@ namespace MediaBrowser.Common.Threading
|
|||||||
|
|
||||||
public PeriodicTimer(Action<object> callback, object state, TimeSpan dueTime, TimeSpan period)
|
public PeriodicTimer(Action<object> callback, object state, TimeSpan dueTime, TimeSpan period)
|
||||||
{
|
{
|
||||||
|
if (callback == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("callback");
|
||||||
|
}
|
||||||
|
|
||||||
Callback = callback;
|
Callback = callback;
|
||||||
_period = period;
|
_period = period;
|
||||||
_state = state;
|
_state = state;
|
||||||
|
@ -44,7 +44,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|||||||
{
|
{
|
||||||
Task.Run(() => LoadCachedAddress());
|
Task.Run(() => LoadCachedAddress());
|
||||||
|
|
||||||
_timer = new PeriodicTimer(null, new TimerCallback(TimerCallback), TimeSpan.FromSeconds(5), TimeSpan.FromHours(3));
|
_timer = new PeriodicTimer(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly string[] _ipLookups = { "http://bot.whatismyipaddress.com", "https://connect.emby.media/service/ip" };
|
private readonly string[] _ipLookups = { "http://bot.whatismyipaddress.com", "https://connect.emby.media/service/ip" };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user