Skip to content

Commit

Permalink
Move resource loading outside of task backend transaction. (#6804)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Jul 6, 2023
1 parent 02df007 commit 30ba202
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/lib/task/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ class TaskBackend {

String? zone, instance;
bool isInstanceDone = false;
final summaryFuture = panaSummary(package, version);
final dartdocIndex = await dartdocFile(package, version, 'index.html');
final summary = await summaryFuture;
await withRetryTransaction(_db, (tx) async {
final key = PackageState.createKey(_db, runtimeVersion, package);
final state = await tx.lookupOrNull<PackageState>(key);
Expand All @@ -631,7 +634,6 @@ class TaskBackend {
await _purgeCache(package, version);

// Update dependencies, if pana summary has dependencies
final summary = await panaSummary(package, version);
if (summary != null && summary.allDependencies != null) {
final updatedDependencies = _updatedDependencies(
state.dependencies,
Expand All @@ -647,7 +649,6 @@ class TaskBackend {
state.dependencies = updatedDependencies;
}
}
final dartdocIndex = await dartdocFile(package, version, 'index.html');

zone = versionState.zone!;
instance = versionState.instance!;
Expand Down

0 comments on commit 30ba202

Please sign in to comment.