File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
src/IoTHub.Portal.Infrastructure/Services/AWS Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -219,11 +219,20 @@ public Task<Configuration> GetConfigItem(string id)
219219
220220 public async Task DeleteConfiguration ( string modelId )
221221 {
222- var modules = await GetConfigModuleList ( modelId ) ;
223-
224- //Deprecate Deployment Thing type
222+ // Deprecate Deployment Thing type
225223 await DeprecateDeploymentThingType ( modelId ) ;
226224
225+ IEnumerable < IoTEdgeModule > modules = Array . Empty < IoTEdgeModule > ( ) ;
226+
227+ try
228+ {
229+ modules = await GetConfigModuleList ( modelId ) ;
230+ }
231+ catch ( InternalServerErrorException e )
232+ {
233+ this . logger . LogError ( $ "Failed to get model modules when deleting. Some resources might persist in AWS for model { modelId } .") ;
234+ }
235+
227236 foreach ( var module in modules . Where ( c => string . IsNullOrEmpty ( c . Id ) ) )
228237 {
229238 try
@@ -261,9 +270,7 @@ public async Task DeleteConfiguration(string modelId)
261270 catch ( AmazonGreengrassV2Exception e )
262271 {
263272 throw new InternalServerErrorException ( "The deletion of the deployment failed due to an error in the Amazon IoT API." , e ) ;
264-
265273 }
266-
267274 }
268275
269276 private async Task DeprecateDeploymentThingType ( string modelId )
@@ -387,7 +394,6 @@ public async Task<List<IoTEdgeModule>> GetConfigModuleList(string modelId)
387394 catch ( Amazon . GreengrassV2 . Model . ResourceNotFoundException )
388395 {
389396 throw new InternalServerErrorException ( "Unable to find the deployment due to an error in the Amazon IoT API. " ) ;
390-
391397 }
392398 }
393399
You can’t perform that action at this time.
0 commit comments