Skip to content

Commit

Permalink
Put in same partition due to bulk operations spanning different parti…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
cammj committed May 10, 2024
1 parent 0e5d219 commit 1219e59
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Sync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,13 @@ private static async Task GetTenantSimulationUsers(GraphServiceClient GraphClien
var pageIterator = Microsoft.Graph.PageIterator<UserSimulationDetails,UserSimulationDetailsCollectionResponse>
.CreatePageIterator(GraphClient, results, async (userSimDetail) =>
{
// Create an identifier for the SimulationUser_Id
string id = $"{SimulationId}-{userSimDetail.SimulationUser?.UserId}";

// Add the table item
tableActionQueue_SimulationUsers.Enqueue(new TableTransactionAction(TableTransactionActionType.UpdateReplace, new TableEntity(SimulationId, userSimDetail.SimulationUser?.UserId)
tableActionQueue_SimulationUsers.Enqueue(new TableTransactionAction(TableTransactionActionType.UpdateReplace, new TableEntity("SimulationUsers", id)
{
{"SimulationUser_Id", $"{SimulationId}-{userSimDetail.SimulationUser?.UserId}"},
{"SimulationUser_Id", id},
{"SimulationUser_UserId", userSimDetail.SimulationUser?.UserId},
{"SimulationUser_Email", userSimDetail.SimulationUser?.Email},
{"CompromisedDateTime", userSimDetail.CompromisedDateTime},
Expand All @@ -347,7 +350,7 @@ private static async Task GetTenantSimulationUsers(GraphServiceClient GraphClien
{
foreach (var simulationUserEvents in userSimDetail.SimulationEvents)
{
tableActionQueue_SimulationUserEvents.Enqueue(new TableTransactionAction(TableTransactionActionType.UpdateReplace, new TableEntity(SimulationId, $"{userSimDetail.SimulationUser?.UserId}_{simulationUserEvents.EventName}_{simulationUserEvents.EventDateTime.Value.ToUnixTimeSeconds()}")
tableActionQueue_SimulationUserEvents.Enqueue(new TableTransactionAction(TableTransactionActionType.UpdateReplace, new TableEntity("SimulationUserEvents", $"{id}_{simulationUserEvents.EventName}_{simulationUserEvents.EventDateTime.Value.ToUnixTimeSeconds()}")
{
{"SimulationUser_Id", $"{SimulationId}-{userSimDetail.SimulationUser?.UserId}"},
{"SimulationUser_UserId", userSimDetail.SimulationUser?.UserId},
Expand Down

0 comments on commit 1219e59

Please sign in to comment.