Skip to content

Commit

Permalink
Refactor(Business): Removed unecessary try catch at replace data base…
Browse files Browse the repository at this point in the history
… entity metadata recover
  • Loading branch information
Raphsodyz committed May 19, 2024
1 parent 1fb02f3 commit 06b3166
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions Business/Business/LaunchApiBusiness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,26 +343,18 @@ private async Task GenerateLog(int offset, string message, int entityCount, bool
private async Task SetOriginalBaseEntityDataProcesses(Launch launch)
{
LaunchBaseEntityAggregate launchBaseEntityAggregate = new();

try
{
await Task.WhenAll(
SetOriginalBaseEntityData(launch.Status, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.LaunchServiceProvider, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Rocket.Configuration, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Rocket, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Mission.Orbit, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Mission, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Pad.Location, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Pad, launchBaseEntityAggregate),
SetOriginalBaseEntityLaunchData(launch, launchBaseEntityAggregate)
);
_mapper.Map(launchBaseEntityAggregate, launch);
}
catch
{
throw;
}
await Task.WhenAll(
SetOriginalBaseEntityData(launch.Status, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.LaunchServiceProvider, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Rocket.Configuration, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Rocket, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Mission.Orbit, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Mission, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Pad.Location, launchBaseEntityAggregate),
SetOriginalBaseEntityData(launch.Pad, launchBaseEntityAggregate),
SetOriginalBaseEntityLaunchData(launch, launchBaseEntityAggregate)
);
_mapper.Map(launchBaseEntityAggregate, launch);
}

private async Task SetOriginalBaseEntityLaunchData(Launch launch, LaunchBaseEntityAggregate aggregateData)
Expand Down

0 comments on commit 06b3166

Please sign in to comment.