From e28b3750d1f60a13d5771663c664dbdc72364cce Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 24 May 2010 12:08:20 +0000 Subject: [PATCH] MGR: If get_results RPC takes x seconds, do it no more often than once every (x *10) seconds svn path=/trunk/boinc/; revision=21613 --- clientgui/MainDocument.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index e78d263d7b..66c66322ee 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -810,6 +810,7 @@ void CMainDocument::RefreshRPCs() { m_dtResultsTimestamp = wxDateTime((time_t)1); // m_iGet_results_rpc_result = -1; } + m_fResultsRPCExecutionTime = 0; if (!m_dtFileTransfersTimestamp.IsEqualTo(wxDateTime((time_t)0))) { m_dtFileTransfersTimestamp = wxDateTime((time_t)1); @@ -1021,9 +1022,7 @@ void CMainDocument::RunPeriodicRPCs(int frameRefreshRate) { ts = dtNow - m_dtResultsTimestamp; wxLongLong secondsSinceLastRPC = ts.GetSeconds(); if (secondsSinceLastRPC >= RESULTSRPC_INTERVAL) { - if ((secondsSinceLastRPC >= (m_fResultsRPCExecutionTime * GET_RESULTS_FREQUENCY_FACTOR)) - // (m_dtResultsTimestamp < 2) means we need immediate refresh - || m_dtResultsTimestamp.IsEarlierThan(wxDateTime((time_t)2))) { + if (secondsSinceLastRPC >= (m_fResultsRPCExecutionTime * GET_RESULTS_FREQUENCY_FACTOR)) { request.clear(); request.which_rpc = RPC_GET_RESULTS; request.arg1 = &async_results_buf;