Fix retry logic for deployment not seeding correctly

This commit is contained in:
Elvin Morales 2018-11-19 15:23:38 -08:00
Родитель 63a32751f6
Коммит 3badbaf364
1 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -74,12 +74,17 @@ namespace Microsoft.Azure.IoTSolutions.UIConfig.Services
}
this.log.Info("Seed begin", () => { });
await this.SeedAsync();
this.log.Info("Seed end", () => { });
await this.SetCompletedFlagAsync();
await this.mutex.LeaveAsync(SEED_COLLECTION_ID, MUTEX_KEY);
try
{
await this.SeedAsync();
this.log.Info("Seed end", () => { });
await this.SetCompletedFlagAsync();
this.log.Info("Seed completed flag set", () => { });
}
finally
{
await this.mutex.LeaveAsync(SEED_COLLECTION_ID, MUTEX_KEY);
}
}
private async Task<bool> CheckCompletedFlagAsync()