-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from bdach/queue-processor-scoping
Allow specifying queue name & scope of calculation in queue processor
- Loading branch information
Showing
5 changed files
with
59 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
osu.Server.DifficultyCalculator/Commands/ProcessingMode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
namespace osu.Server.DifficultyCalculator.Commands | ||
{ | ||
public enum ProcessingMode | ||
{ | ||
All, | ||
Difficulty, | ||
ScoreAttributes | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using JetBrains.Annotations; | ||
using McMaster.Extensions.CommandLineUtils; | ||
using osu.Server.DifficultyCalculator.Commands; | ||
|
||
namespace osu.Server.Queues.BeatmapProcessor | ||
{ | ||
[Command] | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
[Argument(0, "mode", "The target mode to process the beatmaps from the queue in.")] | ||
[UsedImplicitly] | ||
private ProcessingMode processingMode { get; } = ProcessingMode.All; | ||
|
||
[Argument(1, "queue-name", "The name of the queue to watch. The `osu-queue:` prefix must be omitted.")] | ||
[UsedImplicitly] | ||
private string queueName { get; } = "beatmap"; | ||
|
||
public static void Main(string[] args) => CommandLineApplication.Execute<Program>(args); | ||
|
||
[UsedImplicitly] | ||
public int OnExecute(CommandLineApplication app) | ||
{ | ||
new BeatmapProcessor().Run(); | ||
new BeatmapProcessor(processingMode, queueName).Run(); | ||
return 0; | ||
} | ||
} | ||
} |