Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: update_attempter.cc

Issue 4191002: AU: Nice for 2 hours, then normal priority. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « update_attempter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.cc
diff --git a/update_attempter.cc b/update_attempter.cc
index 7c324755aa328e3c97f108c637ca086ed65572f8..5b7f9883a758474848772f8a6c5cf13dc28d82b6 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -472,7 +472,7 @@ void UpdateAttempter::SetupPriorityManagement() {
LOG(ERROR) << "Process priority timeout source hasn't been destroyed.";
CleanupPriorityManagement();
}
- const int kPriorityTimeout = 10 * 60; // 10 minutes
+ const int kPriorityTimeout = 2 * 60 * 60; // 2 hours
manage_priority_source_ = g_timeout_source_new_seconds(kPriorityTimeout);
g_source_set_callback(manage_priority_source_,
StaticManagePriorityCallback,
@@ -495,16 +495,9 @@ gboolean UpdateAttempter::StaticManagePriorityCallback(gpointer data) {
}
bool UpdateAttempter::ManagePriorityCallback() {
- // If the current process priority is below normal, set it to normal
- // and let GLib invoke this callback again.
- if (utils::ComparePriorities(priority_, utils::kProcessPriorityNormal) < 0) {
- SetPriority(utils::kProcessPriorityNormal);
- return true;
- }
- // Set the priority to high and let GLib destroy the timeout source.
- SetPriority(utils::kProcessPriorityHigh);
+ SetPriority(utils::kProcessPriorityNormal);
manage_priority_source_ = NULL;
- return false;
+ return false; // Destroy the timeout source.
}
void UpdateAttempter::DisableDeltaUpdateIfNeeded() {
« no previous file with comments | « update_attempter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698