1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 16:53:26 +00:00

[PM-1646] Add thread safety to migration process (#2453)

* Make migration process thread safe

* tweaks
This commit is contained in:
mp-bw
2023-03-28 17:22:09 -04:00
committed by GitHub
parent d7d044f717
commit 99ceb8dbc1
3 changed files with 25 additions and 9 deletions

View File

@@ -1537,11 +1537,8 @@ namespace Bit.Core.Services
{
if (!_migrationChecked)
{
var migrationService = ServiceContainer.Resolve<IStateMigrationService>("stateMigrationService");
if (await migrationService.NeedsMigration())
{
await migrationService.Migrate();
}
var migrationService = ServiceContainer.Resolve<IStateMigrationService>();
await migrationService.MigrateIfNeededAsync();
_migrationChecked = true;
}