-
Notifications
You must be signed in to change notification settings - Fork 2
Fix the telemetry exception handling for daemon mode #60
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 1 commit
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 |
---|---|---|
|
@@ -190,10 +190,18 @@ def send( | |
impl(payload) | ||
|
||
def _send_daemon(self, payload): | ||
cmd = ( | ||
f"import requests;requests.post('{self.url}'," | ||
f"params={{'token':'{self.token}'}},json={payload})" | ||
) | ||
cmd = f""" | ||
import requests, logging | ||
try: | ||
requests.post( | ||
'{self.url}', | ||
params={{'token':'{self.token}'}}, | ||
json={payload}, | ||
timeout=2 | ||
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. I think it should be safe to make it 10+ seconds? 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. I used the default from the timeout we already had for thread based or normal method of sending the request. I am not sure if we want to have timeout upto 10 seconds delay to close a program when program already failed for the user. 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.
are we waiting for the process to exit / complete on the user program exit? 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. Looks like we have 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. Well, |
||
) | ||
except (requests.exceptions.RequestException, Exception) as e: | ||
amritghimire marked this conversation as resolved.
Show resolved
Hide resolved
|
||
logging.debug(f'Telemetry request failed: {{str(e)}}') | ||
""" | ||
|
||
if os.name == "nt": | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.