Skip to content

Commit ab1ee0b

Browse files
committed
Disable discovery in cloud function example
1 parent e3bd813 commit ab1ee0b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • examples/cloud-function-trivial-example

examples/cloud-function-trivial-example/index.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import os
22
import ydb
33

4+
5+
driver_config = ydb.DriverConfig(
6+
endpoint=os.getenv("YDB_ENDPOINT"),
7+
database=os.getenv("YDB_DATABASE"),
8+
disable_discovery=True, # it is recommended to disable discovery for cloud functions
9+
)
410
# create driver in global space.
5-
driver = ydb.Driver(endpoint=os.getenv("YDB_ENDPOINT"), database=os.getenv("YDB_DATABASE"))
11+
driver = ydb.Driver(driver_config)
612
# Wait for the driver to become active for requests.
713
driver.wait(fail_fast=True, timeout=5)
814
# Create the session pool instance to manage YDB sessions.

0 commit comments

Comments
 (0)