Skip to content
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

[FIX] Send usage statistics in a thread at startup #3632

Merged
merged 2 commits into from
Mar 15, 2019

Conversation

rokgomiscek
Copy link
Contributor

Issue

Fixes #3597

Description of changes

When closing Orange, usage statistics are saved. Then, when starting Orange, usage statistics are sent in the background.

Includes
  • Code changes
  • Tests
  • Documentation

@markotoplak markotoplak self-assigned this Mar 7, 2019
@codecov
Copy link

codecov bot commented Mar 7, 2019

Codecov Report

Merging #3632 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3632      +/-   ##
==========================================
+ Coverage   84.43%   84.43%   +<.01%     
==========================================
  Files         372      372              
  Lines       68111    68111              
==========================================
+ Hits        57511    57512       +1     
+ Misses      10600    10599       -1

@@ -271,6 +272,16 @@ def compare_versions(latest):
thread.start()
return thread

def send_usage_statistics():

class SendUsageStatistics(QThread):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there is an uncaught exception in a QThread for any reason? I faintly remember some problems with crashing and uncaught exceptions in threads, but that might be just my imagination.

Also, as this addition is a non-vital part of Orange, I recommend being defensive. See send_usage_statistics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean like this? I added an except Exception to send_statistics.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit that moves checking for exception to run(). Because, for example, an exception could also happen in json loading (if file was saved incorrectly). Could you verify if everything is still OK?

@janezd janezd assigned rokgomiscek and unassigned markotoplak Mar 15, 2019
@markotoplak markotoplak changed the title [ENH] Send usage statistics in the background when Orange is started [FIX] Send usage statistics in a thread at startup Mar 15, 2019
@markotoplak markotoplak merged commit 2f1325f into biolab:master Mar 15, 2019
@rokgomiscek rokgomiscek deleted the SendUsageOnStartup branch March 22, 2019 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants