Skip to content

Commit

Permalink
Not all queue endpoints are init friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Mar 14, 2024
1 parent e4f14e8 commit b75f926
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Shoko.Server/API/v3/Controllers/QueueController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace Shoko.Server.API.v3.Controllers;
/// </summary>
[ApiController, Route("/api/v{version:apiVersion}/[controller]"), ApiV3]
[DatabaseBlockedExempt]
[InitFriendly]
public class QueueController : BaseController
{
private readonly QueueHandler _queueHandler;
Expand All @@ -35,6 +34,7 @@ public QueueController(ISettingsProvider settingsProvider, QueueHandler queueHan
/// </summary>
/// <returns>Info about the queue</returns>
[HttpGet]
[InitFriendly]
public Queue GetQueue()
{
return new Queue
Expand All @@ -60,6 +60,7 @@ public Queue GetQueue()
/// </summary>
/// <returns>A dictionary of all the queued and active command types, and the count for each type.</returns>
[HttpGet("Types")]
[InitFriendly]
public async Task<ActionResult<Dictionary<string, int>>> GetTypesForItemsInAllQueues()
{
return await _queueHandler.GetJobCounts();
Expand All @@ -71,6 +72,7 @@ public async Task<ActionResult<Dictionary<string, int>>> GetTypesForItemsInAllQu
/// <returns>Void.</returns>
[Authorize("admin")]
[HttpPost("Resume")]
[InitFriendly]
public async Task<ActionResult> Resume()
{
await _queueHandler.Resume();
Expand All @@ -83,6 +85,7 @@ public async Task<ActionResult> Resume()
/// <returns>Void.</returns>
[Authorize("admin")]
[HttpPost("Pause")]
[InitFriendly]
public async Task<ActionResult> Pause()
{
await _queueHandler.Pause();
Expand All @@ -95,6 +98,7 @@ public async Task<ActionResult> Pause()
/// <returns>Void.</returns>
[Authorize("admin")]
[HttpPost("Clear")]
[InitFriendly]
public async Task<ActionResult> Clear()
{
await _queueHandler.Clear();
Expand Down

0 comments on commit b75f926

Please sign in to comment.