Skip to content

Commit

Permalink
Merge pull request #2109 from jenkinsci/JENKINS-32190
Browse files Browse the repository at this point in the history
Revert JENKINS-32190 fix
  • Loading branch information
kohsuke committed Mar 10, 2016
2 parents f56ace5 + b2013ed commit b67bb4c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/src/main/java/hudson/model/UsageStatistics.java
Expand Up @@ -31,7 +31,6 @@
import hudson.util.IOUtils;
import hudson.util.Secret;
import static hudson.util.TimeUnit2.DAYS;
import static hudson.init.InitMilestone.COMPLETED;

import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
Expand Down Expand Up @@ -96,12 +95,9 @@ public UsageStatistics(String keyImage) {
* Returns true if it's time for us to check for new version.
*/
public boolean isDue() {
final Jenkins j = Jenkins.getInstance();
// user opted out or Jenkins not fully initialized. no data collection.
if (j == null || j.isUsageStatisticsCollected() || DISABLED || COMPLETED.compareTo(j.getInitLevel()) > 0) {
return false;
}

// user opted out. no data collection.
if(!Jenkins.getInstance().isUsageStatisticsCollected() || DISABLED) return false;

long now = System.currentTimeMillis();
if(now - lastAttempt > DAY) {
lastAttempt = now;
Expand Down

0 comments on commit b67bb4c

Please sign in to comment.