Skip to content

Task Query and Retry ​

Updated

Does a Returned TaskId Mean Generation Is Complete? ​

A returned TaskId means the asynchronous task has been accepted. Check the completion status and result fields in the corresponding query API before you use the file. Do not decide that generation succeeded based on the acceptance response alone.

Which API Is Used to Query Task Status? ​

Use the query API that corresponds to the API used to create the task. VOD AIGC uses DescribeTaskDetail. For MPS AIGC, image, video, and audio tasks use DescribeAigcImageTask, DescribeAigcVideoTask, and DescribeAigcAudioTask respectively. MPS ProcessMedia tasks use DescribeTaskDetail, and standalone image processing tasks use DescribeImageTaskDetail. Even if the names look similar, do not mix TaskIds from different tasks.

Can I Create the Task Again Right After a Request Times Out? ​

Even if you did not receive a response, the server may already have accepted the task. If you have a TaskId, query its status first. If you have no identifier, record the request time and request identifier and check whether the task was accepted. Repeating generation requests unconditionally can create duplicate tasks and duplicate costs.

How Do I Configure the Query Interval and Retries? ​

Observe the call limits of API and increase the retry interval progressively. To avoid having many tasks query at the same moment, you can add a random delay to the interval. Stop querying once you receive a terminal status such as completed or failed, and configure a maximum wait time for your application separately.

How Do I Tell a Failed Task from a Failed Query Request? ​

Distinguish between a failed task query HTTP request and the final failure of a generation task. A transient network error can be retried, but if the task is in a final failed state, check the returned error code and the input conditions. Do not repeat requests without fixing authentication or parameter errors.

Source:docs/wand/docs/faq-tasks.md ​

Built with VitePress · Deployed on Tencent EdgeOne Pages