mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 21:46:01 +00:00
refactor(resources): share the retained close-owner adapter (#14562)
This commit is contained in:
1 parent
0bbdbeaedf
commit
3d9ceeae6b
15 files changed
+45
-148
No files matched your search
@@ -1,6 +1,5 @@
|
||||
import { ProviderInspectionScope } from "../../ports/ProviderInspectionScope.js";
|
||||
import {
|
||||
AnalysisCleanupLease,
|
||||
ArtifactResourceScope,
|
||||
ArtifactReaderFailure,
|
||||
bindArtifactFileCleanup,
|
||||
@@ -146,15 +145,7 @@ export class AnalysisProviderRegistry {
|
||||
AnalysisCleanupRelease
|
||||
>();
|
||||
readonly #profileResources = new ArtifactResourceScope();
|
||||
readonly #profileOwner: RetainedResourceScope = {
|
||||
retain: (owner, resource) =>
|
||||
this.#profileResources.retain({
|
||||
kind: "lease",
|
||||
resource,
|
||||
lease: AnalysisCleanupLease.forCloseOwner(owner, resource),
|
||||
}),
|
||||
run: (operation) => this.#profileResources.run(operation),
|
||||
};
|
||||
readonly #profileOwner = this.#profileResources.forCloseOwners();
|
||||
#closing: Promise<Result<null, AnalysisError>> | undefined;
|
||||
|
||||
constructor(
|
||||
|
||||
Reference in new issue
Block a user