feat(session): share the session directory between instances
Publish every session to valkey with the instance holding it, and route a command for a non-local session to its owner over a per-instance pub/sub channel. Entries expire, so a dead instance leaves the directory.
This commit is contained in:
@@ -52,18 +52,19 @@ public class SessionController : BaseJellyfinApiController
|
||||
[HttpGet("Sessions")]
|
||||
[Authorize]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public ActionResult<IReadOnlyList<SessionInfoDto>> GetSessions(
|
||||
public async Task<ActionResult<IReadOnlyList<SessionInfoDto>>> GetSessions(
|
||||
[FromQuery] Guid? controllableByUserId,
|
||||
[FromQuery] string? deviceId,
|
||||
[FromQuery] int? activeWithinSeconds)
|
||||
{
|
||||
Guid? controllableUserToCheck = controllableByUserId is null ? null : RequestHelpers.GetUserId(User, controllableByUserId);
|
||||
var result = _sessionManager.GetSessions(
|
||||
var result = await _sessionManager.GetSessions(
|
||||
User.GetUserId(),
|
||||
deviceId,
|
||||
activeWithinSeconds,
|
||||
controllableUserToCheck,
|
||||
User.GetIsApiKey());
|
||||
User.GetIsApiKey(),
|
||||
HttpContext.RequestAborted).ConfigureAwait(false);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user