Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Barbero2016-11-15 14:46:36 +0000
committerPascal Rapicault2016-11-23 18:21:23 +0000
commit22969d7e2941e3aebc18ff88c8cc4fc9664353f9 (patch)
tree1b5929e8817525cbad8ca535e344959feb99f567 /bundles/org.eclipse.equinox.p2.updatechecker
parentec0e89de420e1c0c3bce490799a7eba44338b294 (diff)
downloadrt.equinox.p2-22969d7e2941e3aebc18ff88c8cc4fc9664353f9.tar.gz
rt.equinox.p2-22969d7e2941e3aebc18ff88c8cc4fc9664353f9.tar.xz
rt.equinox.p2-22969d7e2941e3aebc18ff88c8cc4fc9664353f9.zip
Checking the servers for update at a fixed time on fixed day of the week can kneel the servers. However, activating automatic check for updates on EPP packages is only possible by specifying a fix day and hour (see bug 421779 for the decision). This patch replace the fixed time of the day/week of the day way check for updates are scheduled. Users can choose to check "once a day", "once a week" or "once a month". The initial time used for next checks is the time when the user activates the option. However, it never checks for update exactly after a day, a week or a month. It introduces some randomness: - If the delay for checking for update is passed, it schedules a check sometime in the next 8 hours. - If the delay is well overpassed (see definition of "well overpassed" below), it schedules a check in the next hour. The delay is considered "well overpassed" depending on the recurrence of the check: - If the recurrence is "once a day", the delay is considered overpassed after a day and 6 hours. - If the recurrence is "once a week", the delay is considered overpassed after a week and 2 days. - If the recurrence is "once a month", the delay is considered overpassed after a week and 6 days. It also migrates automatically the fixed weekday/time preferences to the new fuzzy scheduler. Change-Id: I74a8bfba6b711e98eb795c1f924840e68789f102 Signed-off-by: Mikael Barbero <mikael@eclipse.org> Signed-off-by: Pascal Rapicault <pascal@rapicorp.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.updatechecker')
-rw-r--r--bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/provisional/p2/updatechecker/IUpdateListener.java5
2 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java
index f876bc018..54a6ab5a2 100644
--- a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java
+++ b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Sonatype, Inc. - ongoing development
+ * Mikael Barbero (Eclipse Foundation) - Bug 498116
*******************************************************************************/
package org.eclipse.equinox.internal.p2.updatechecker;
@@ -68,7 +69,7 @@ public class UpdateChecker implements IUpdateChecker {
Thread.sleep(delay);
}
while (!done) {
-
+ listener.checkingForUpdates();
trace("Checking for updates for " + profileId + " at " + getTimeStamp()); //$NON-NLS-1$ //$NON-NLS-2$
Collection<IInstallableUnit> iusWithUpdates = checkForUpdates(profileId, query);
if (iusWithUpdates.size() > 0) {
diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/provisional/p2/updatechecker/IUpdateListener.java b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/provisional/p2/updatechecker/IUpdateListener.java
index 7cde63663..c4b115b99 100644
--- a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/provisional/p2/updatechecker/IUpdateListener.java
+++ b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/provisional/p2/updatechecker/IUpdateListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 20016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Mikael Barbero (Eclipse Foundation) - Bug 498116
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.updatechecker;
@@ -18,4 +19,6 @@ package org.eclipse.equinox.internal.provisional.p2.updatechecker;
public interface IUpdateListener {
public void updatesAvailable(UpdateEvent event);
+
+ public void checkingForUpdates();
}

Back to the top