untilstring[]["waiting", "succeeded", "failed", "cancelled"]و التي تنتهي حالة الانتظار
timeoutMsinteger600 000عشر دقائق، مررها timeout (4008) تم إلقائها.
intervalMsinteger2 000كم مرة تعيد قراءة هذا
await run.wait();
if (run.data.status === "waiting") {
const step = run.data.steps.find((s) => s.status === "waiting");
await run.resume(step.id, { approved: true });
await run.wait(); // then on to the end
}run.wait()
if run.data["status"] == "waiting":
step = next(s for s in run.data["steps"] if s["status"] == "waiting")
run.resume(step["id"], {"approved": True})
run.wait() # then on to the endلماذا الانتظار في حالة العجز
وبدون الانتظار في القائمة، تنتهي الانتظار الافتراضي دائماً في فترة زمنية محددة على أي تدفق للعمل مع موافقة - وسيبدو الوقت المستغرق كفشل. فعاملة "التوقف بالنسبة لشخص" باعتباره وصولاً هو ما يجعل التقصير مفيداً.
ينتظر فقط النهاية
await run.wait({ until: ["succeeded", "failed", "cancelled"], timeoutMs: 30 * 60_000 });run.wait(until=["succeeded", "failed", "cancelled"], timeout_ms=30 * 60_000)( ١ بطرس ٣ : ١ ) فَٱلْمَسِيحِيُّونَ ٱلْمُقَدَّسُونَ يَسْتَخْدِمُونَ ٱلْمَسِيحِيُّونَ ٱلْمُقَدَّسُونَ مَعَ ٱلْمَسِيحِيِّينَ .
الوقت المنقضي لا يوقف الركض
هو يُلقي timeout و الركض يستمر بالسير، أمسكه و عد لاحقاً مع أنتRunRun أو - أو - أو إلغاء () إذا كنت تنوي إيقافه
import { IaGenifyError } from "iagenify";
try {
await run.wait({ timeoutMs: 60_000 });
} catch (err) {
if (err instanceof IaGenifyError && err.code === "timeout") {
// Still running. Keep run.id and come back.
} else throw err;
}from iagenify import IaGenifyError
try:
run.wait(timeout_ms=60_000)
except IaGenifyError as error:
if error.code != "timeout":
raise
# Still running. Keep run.id and come back.الـ هو حرّ، لكن ليس conf
كل علامة هي قراءة وقراءة تكلفة لا شيء، وفترة أقصر تتفاعل بسرعة أكبر وتقدم طلبات أكثر - ثانيتان هو التوازن المختار.