优化Dispose方法清楚缓存数据
This commit is contained in:
parent
7b9ba185fc
commit
7373763e9f
|
@ -428,6 +428,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors
|
|||
{
|
||||
dataSourceDbContext.Value.Dispose();
|
||||
}
|
||||
_dataSourceDbContexts.Clear();
|
||||
}
|
||||
#if !EFCORE2
|
||||
public async ValueTask DisposeAsync()
|
||||
|
@ -436,6 +437,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors
|
|||
{
|
||||
await dataSourceDbContext.Value.DisposeAsync();
|
||||
}
|
||||
_dataSourceDbContexts.Clear();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -279,6 +279,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors
|
|||
{
|
||||
dbContextCache.Value.Dispose();
|
||||
}
|
||||
_dbContextCaches.Clear();
|
||||
}
|
||||
#if !EFCORE2
|
||||
|
||||
|
@ -374,6 +375,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors
|
|||
{
|
||||
await dbContextCache.Value.DisposeAsync();
|
||||
}
|
||||
_dbContextCaches.Clear();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue