mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 21:23:45 +00:00
feat(errors): name a deadline's parameter or environment control in details.limit (#11172)
This commit is contained in:
1 parent
2d4a97b405
commit
863d82e370
16 files changed
+159
-50
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import { z } from "zod";
|
||||
import type {
|
||||
AnalysisControlLimit,
|
||||
AnalysisInvocationSettingLimit,
|
||||
AnalysisLimit,
|
||||
AnalysisSettingId,
|
||||
AnalysisSettingLimit,
|
||||
} from "./analysisSettings.js";
|
||||
@@ -650,7 +652,17 @@ export const analysisSettingLimit = (
|
||||
};
|
||||
|
||||
/** Re-scope an enforced limit for a caller whose runtime ended with this invocation. */
|
||||
export const invocationSettingLimit = ({
|
||||
export const invocationLimit = (
|
||||
limit: AnalysisLimit,
|
||||
): AnalysisInvocationSettingLimit | AnalysisControlLimit => {
|
||||
if (!("control_kind" in limit)) return invocationSettingLimit(limit);
|
||||
// A new invocation reads its environment without restarting a running REA.
|
||||
return limit.control_kind === "environment"
|
||||
? { ...limit, applies_at: "next_invocation" }
|
||||
: { ...limit };
|
||||
};
|
||||
|
||||
const invocationSettingLimit = ({
|
||||
applies_at: _appliesAt,
|
||||
scope: _scope,
|
||||
...facts
|
||||
|
||||
Reference in new issue
Block a user