Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpatrick57 committed Nov 14, 2024
1 parent 875ad1a commit f9003ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions env/pg_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ def move_log(self) -> None:
shutil.move(pglog_fpath, pglog_this_step_fpath)
self.log_step += 1

def time_query(
self, query: str, timeout: float
) -> tuple[float, bool, Any]:
def time_query(self, query: str, timeout: float) -> tuple[float, bool, Any]:
"""
Run a query with a timeout. If you want to attach per-query knobs, attach them to the query string itself.
Expand Down
4 changes: 1 addition & 3 deletions tune/protox/env/util/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def _acquire_metrics_around_query(
query_timeout == 0
), f'Setting query_timeout to 0 indicates "timeout". However, setting query_timeout ({query_timeout}) < 0 is a bug.'

qid_runtime, did_time_out, explain_data = pg_conn.time_query(
query, query_timeout
)
qid_runtime, did_time_out, explain_data = pg_conn.time_query(query, query_timeout)

# Wipe the statement timeout.
_force_statement_timeout(pg_conn.conn(), 0)
Expand Down

0 comments on commit f9003ab

Please sign in to comment.