mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
update realtime monitor
This commit is contained in:
@@ -87,8 +87,9 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
|
||||
|
||||
private void ProcessContext(HttpListenerContext context)
|
||||
{
|
||||
//Task.Factory.StartNew(() => InitTask(context), TaskCreationOptions.DenyChildAttach | TaskCreationOptions.PreferFairness);
|
||||
Task.Run(() => InitTask(context, _disposeCancellationToken));
|
||||
_logger.Info("thread id {0}", Thread.CurrentThread.ManagedThreadId);
|
||||
InitTask(context, _disposeCancellationToken);
|
||||
//Task.Run(() => InitTask(context, _disposeCancellationToken));
|
||||
}
|
||||
|
||||
private Task InitTask(HttpListenerContext context, CancellationToken cancellationToken)
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace Emby.Server.Implementations.IO
|
||||
|
||||
try
|
||||
{
|
||||
await item.ChangedExternally().ConfigureAwait(false);
|
||||
item.ChangedExternally();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
@@ -282,11 +282,11 @@ namespace Emby.Server.Implementations.IO
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//catch (DirectoryNotFoundException)
|
||||
//{
|
||||
// // File may have been deleted
|
||||
// return false;
|
||||
//}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
// File may have been deleted
|
||||
return false;
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
// File may have been deleted
|
||||
|
||||
@@ -66,19 +66,19 @@ namespace Emby.Server.Implementations.Session
|
||||
return SendMessage(name, new Dictionary<string, string>(), cancellationToken);
|
||||
}
|
||||
|
||||
private async Task SendMessage(string name,
|
||||
private Task SendMessage(string name,
|
||||
Dictionary<string, string> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var url = PostUrl + "/" + name + ToQueryString(args);
|
||||
|
||||
await _httpClient.Post(new HttpRequestOptions
|
||||
return _httpClient.Post(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
CancellationToken = cancellationToken,
|
||||
BufferContent = false
|
||||
|
||||
}).ConfigureAwait(false);
|
||||
});
|
||||
}
|
||||
|
||||
public Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken)
|
||||
@@ -159,8 +159,24 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
public Task SendMessage<T>(string name, T data, CancellationToken cancellationToken)
|
||||
{
|
||||
// Not supported or needed right now
|
||||
return Task.FromResult(true);
|
||||
var url = PostUrl + "/" + name;
|
||||
|
||||
var options = new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
CancellationToken = cancellationToken,
|
||||
BufferContent = false
|
||||
};
|
||||
|
||||
options.RequestContent = _json.SerializeToString(data);
|
||||
options.RequestContentType = "application/json";
|
||||
|
||||
return _httpClient.Post(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
CancellationToken = cancellationToken,
|
||||
BufferContent = false
|
||||
});
|
||||
}
|
||||
|
||||
private string ToQueryString(Dictionary<string, string> nvc)
|
||||
|
||||
Reference in New Issue
Block a user