Skip to content

Commit

Permalink
with invalid cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Itoktsnhc committed Aug 30, 2023
1 parent 93775f9 commit 9a7b559
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Stat.Itok.Tests/RecallTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,29 @@ public async Task ResetJobConfigEnableAndLimitAsync()
}
}

[TestMethod]
public async Task DeleteInvalidJobHisByTimeRangeAsync()
{
var cosmos = _sp.GetRequiredService<CosmosDbAccessor>();
var container = cosmos.GetContainer<BattleTaskPayload>();
var rawSQL =
$"SELECT * FROM c where c.partitionKey = 'prod.BattleTaskPayload' and c.data.jobConfigId ='nin_user_47b6e130639b6029' and c._ts >1693302503\r\n";
QueryDefinition query = new QueryDefinition(rawSQL);

var resultSetIterator = container.GetItemQueryIterator<PureIdDto>(
query);

while (resultSetIterator.HasMoreResults)
{
var response = await resultSetIterator.ReadNextAsync();
foreach (var entity in response)
{
await container.DeleteItemAsync<PureIdDto>(entity.Id,
new Microsoft.Azure.Cosmos.PartitionKey("prod.BattleTaskPayload"));
}
}
}


private class PureIdDto
{
Expand Down

0 comments on commit 9a7b559

Please sign in to comment.