Skip to content

Commit 8a4c191

Browse files
EXPEbdodlaBhargav Dodla
andauthored
fix: added pool_recycle option to create_engine (#12)
Co-authored-by: Bhargav Dodla <bdodla@expediagroup.com>
1 parent 32232c4 commit 8a4c191

File tree

1 file changed

+5
-1
lines changed
  • sdk/python/feast/infra/registry

1 file changed

+5
-1
lines changed

sdk/python/feast/infra/registry/sql.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ def __init__(
202202
repo_path: Optional[Path],
203203
):
204204
assert registry_config is not None, "SqlRegistry needs a valid registry_config"
205-
self.engine: Engine = create_engine(registry_config.path, echo=False)
205+
# pool_recycle will recycle connections after the given number of seconds has passed
206+
# This is to avoid automatic disconnections when no activity is detected on connection
207+
self.engine: Engine = create_engine(
208+
registry_config.path, echo=False, pool_recycle=3600
209+
)
206210
metadata.create_all(self.engine)
207211
self.cached_registry_proto = self.proto()
208212
proto_registry_utils.init_project_metadata(self.cached_registry_proto, project)

0 commit comments

Comments
 (0)