Skip to content

Commit

Permalink
fix: incomplete config check
Browse files Browse the repository at this point in the history
Signed-off-by: yexuanruche <chengt@cpchain.io>
  • Loading branch information
cpcchengt committed Aug 4, 2024
1 parent 7eacfd7 commit ec497e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opengemini_client/client_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def check_config(config: Config):
if config.batch_config.batch_size <= 0:
raise ValueError("batch enabled,batch size must be greater than 0")

if config.timeout <= datetime.timedelta(seconds=0):
if config.timeout is None or config.timeout <= datetime.timedelta(seconds=0):
config.timeout = datetime.timedelta(seconds=30)

if config.connection_timeout <= datetime.timedelta(seconds=0):
if config.connection_timeout is None or config.connection_timeout <= datetime.timedelta(seconds=0):
config.connection_timeout = datetime.timedelta(seconds=10)

return config
Expand Down

0 comments on commit ec497e5

Please sign in to comment.