-
Notifications
You must be signed in to change notification settings - Fork 680
[fix] Update watch command execution time to be correct for all iterations (#763) #1428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
f23d58f
a748612
d65cddf
fe81ae7
74f2df0
b488ceb
35fca95
1a176da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -566,11 +566,15 @@ def watch_query(arg: str, **kwargs) -> Generator[tuple, None, None]: | |
| set_pager_enabled(False) | ||
| for sql, title in sql_list: | ||
| cur.execute(sql) | ||
| command = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why a dict instead of two new properties?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't want to add a bunch of random properties (presuming other commands will need other args), so figured a general command property with the dict that could be added to as needed would be better. But if you prefer having standalone properties for it all I can do that.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your implementation, your call.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay I'll keep it as-is then. Don't want to make too many assumptions about future use since this is the first use case, and it can be adjusted later if we find another approach makes more sense given new use cases. Current imagined use case is other commands needing special args, and it fits that anyway. |
||
| "name": "watch", | ||
| "seconds": seconds, | ||
| } | ||
| if cur.description: | ||
| headers = [x[0] for x in cur.description] | ||
| yield (title, cur, headers, None) | ||
| yield (title, cur, headers, None, command) | ||
| else: | ||
| yield (title, None, None, None) | ||
| yield (title, None, None, None, command) | ||
| sleep(seconds) | ||
| except KeyboardInterrupt: | ||
| # This prints the Ctrl-C character in its own line, which prevents | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.