[Quantproject-developers] QuantProject/b3_Data/DataProviders/Caching Cache.cs, 1.5, 1.6
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2010-03-27 17:29:28
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Caching In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3945/DataProviders/Caching Modified Files: Cache.cs Log Message: A bug has been fixed. In some rare case, a page was removed just after having been added and the following access to the page resulted in an exception Index: Cache.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataProviders/Caching/Cache.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Cache.cs 29 Sep 2008 21:12:47 -0000 1.5 --- Cache.cs 27 Mar 2010 17:29:20 -0000 1.6 *************** *** 3,7 **** Cache.cs ! Copyright (C) 2003 Glauco Siliprandi --- 3,7 ---- Cache.cs ! Copyright (C) 2003 Glauco Siliprandi *************** *** 19,23 **** along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; using System.Collections; --- 19,23 ---- along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; using System.Collections; *************** *** 89,98 **** } private CachePage getCachePage( string ticker , int year , ! QuoteField quoteField ) { return (CachePage)( this[ this.getKey( ticker , year , quoteField ) ] ); } private CachePage getCachePage( string ticker , DateTime dateTime , ! QuoteField quoteField ) { return this.getCachePage( ticker , dateTime.Year , quoteField ); --- 89,98 ---- } private CachePage getCachePage( string ticker , int year , ! QuoteField quoteField ) { return (CachePage)( this[ this.getKey( ticker , year , quoteField ) ] ); } private CachePage getCachePage( string ticker , DateTime dateTime , ! QuoteField quoteField ) { return this.getCachePage( ticker , dateTime.Year , quoteField ); *************** *** 139,143 **** this.removeUnusedPages(); CachePage cachePage = new CachePage( ticker , year , quoteField ); ! cachePage.LoadData(); this.Add( this.getKey( ticker , year , quoteField ) , cachePage ); this.currentNumPages ++ ; --- 139,147 ---- this.removeUnusedPages(); CachePage cachePage = new CachePage( ticker , year , quoteField ); ! cachePage.LoadData(); ! ! // this.currentPageRank ++ ; ! cachePage.Rank = this.currentPageRank++; ! this.Add( this.getKey( ticker , year , quoteField ) , cachePage ); this.currentNumPages ++ ; *************** *** 189,193 **** string message = ex.Message; // to avoid warning returnValue = this.GetQuote( ticker , ! new DateTime( dateTime.Year - 1 , 12 , 31 ) , quoteField ); } return returnValue; --- 193,197 ---- string message = ex.Message; // to avoid warning returnValue = this.GetQuote( ticker , ! new DateTime( dateTime.Year - 1 , 12 , 31 ) , quoteField ); } return returnValue; *************** *** 214,218 **** { // forces quote caching ! this.GetQuote( ticker , dateTime , QuoteField.Open ); bool wasExchanged = this.wasExchanged_withCachingAlreadyForced( ticker , dateTime ); --- 218,229 ---- { // forces quote caching ! try ! { ! this.GetQuote( ticker , dateTime , QuoteField.Open ); ! } ! catch ( MissingQuoteException missingQuoteException ) ! { ! string doNothing = missingQuoteException.Message; doNothing += ""; ! } bool wasExchanged = this.wasExchanged_withCachingAlreadyForced( ticker , dateTime ); |