> For the complete documentation index, see [llms.txt](https://smallso.gitbook.io/tencent-cloud-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/class-and-method/client/run-schedule.md).

# run\_schedule 方法

## 简要

运行所有已创建的定时无服务器云函数调用任务，直到没有仍未调用的定时任务存在时该方法返回。这些任务通常由实例方法 [schedule\_invoke](https://smallso.gitbook.io/tencent-cloud-sdk/python-docs/serverless-functions/class-and-method/client/schedule-invoke) 创建。

{% hint style="danger" %}
请注意，该方法仅适用于同步编程方式，异步编程方式无需手动调用该方法。
{% endhint %}

```python
def run_schedule(self)
```

### 兼容性

该实例方法在产品软件包 tencent-cloud-sdk-serverless-functions - 0.1.2 版本中新增。如果产品软件包低于适用版本，应该使用底层级 API 模拟实现：

```python
function_client.get_event_loop().run_forever()
```

否则，已创建的定时无服务器云函数调用任务可能永远不会被运行。

## 参数

该方法没有参数。

## 返回值

该方法没有返回值。

## 异常

该方法可能会主动引发以下异常：

#### StatusError

没有已创建的定时调用任务需要运行或正在运行。

## 示例

下面我们将通过一段 Python 代码向您演示如何使用该方法：

```python
function_client.run_schedule()
```

## 适用于

#### Tencent Cloud SDK for Python

产品软件包：tencent-cloud-sdk-serverless-functions >= 0.1.2
