mirror of
https://github.com/morluto/rea.git
synced 2026-12-01 02:49:12 +00:00
refactor(resources): share artifact cleanup errors with their leases (#14606)
This commit is contained in:
1 parent
bfa50774f5
commit
b16df9d6c7
8 files changed
+49
-76
No files matched your search
@@ -11,9 +11,8 @@ import {
|
||||
} from "../../domain/javascript/javascriptSemanticWorkAllowance.js";
|
||||
import { MAX_NODE_TIMER_DELAY_MS } from "../../domain/analysisResourceLimits.js";
|
||||
import {
|
||||
artifactFileCleanupError,
|
||||
ArtifactResourceScope,
|
||||
ArtifactReaderFailure,
|
||||
bindArtifactFileCleanup,
|
||||
} from "../../resources/index.js";
|
||||
import { analysisErrorWithCleanupDependencies } from "../../domain/analysisErrorCleanup.js";
|
||||
import {
|
||||
@@ -1443,16 +1442,8 @@ export class JavaScriptAnalysisWorker {
|
||||
: cancellation.capturedOutput === undefined
|
||||
? cancellation.retainCapturedOutput(this.#captured())
|
||||
: cancellation;
|
||||
if (cause instanceof ArtifactReaderFailure && cause.cleanup !== undefined) {
|
||||
const error = new ProviderCleanupError(
|
||||
PROVIDER,
|
||||
cause.cleanup.resources,
|
||||
{ reason: cause.cleanup.reason },
|
||||
{ operation: OPERATION, cause },
|
||||
);
|
||||
bindArtifactFileCleanup(cause, error);
|
||||
return error;
|
||||
}
|
||||
const fileCleanup = artifactFileCleanupError(cause, PROVIDER, OPERATION);
|
||||
if (fileCleanup !== undefined) return fileCleanup;
|
||||
if (
|
||||
cause instanceof AnalysisError &&
|
||||
(deadline === undefined || this.#phase === "startup")
|
||||
|
||||
Reference in new issue
Block a user