Skip to content

Commit

Permalink
Merge pull request #159 from notbakaneko/feature/set-alias-then-list
Browse files Browse the repository at this point in the history
Set alias before listing indices
  • Loading branch information
peppy authored Jan 17, 2025
2 parents 62a9358 + ceeee7f commit 00a5642
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions osu.ElasticIndexer/Commands/Index/UpdateAliasCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ public class UpdateAliasCommand : ListIndicesCommand

public override int OnExecute(CancellationToken token)
{
if (base.OnExecute(token) != 0)
return -1;

if (string.IsNullOrWhiteSpace(Schema))
{
Console.WriteLine("A schema version is required.");
Expand All @@ -43,6 +40,10 @@ public override int OnExecute(CancellationToken token)
ElasticClient.UpdateAlias(AppSettings.AliasName, indexName, Close);

Redis.SetCurrentSchema(indexName);

if (base.OnExecute(token) != 0)
return -1;

return 0;
}
}
Expand Down

0 comments on commit 00a5642

Please sign in to comment.