Skip to content

Commit

Permalink
2004-10-03 Ben Maurer <bmaurer@ximian.com>
Browse files Browse the repository at this point in the history
	* Cache.cs, CacheEntry.cs, CacheExpires.cs, ExpiresBuckets.cs:
	use UtcNow rather than Now.

svn path=/branches/mono-1-0/mcs/; revision=34641
  • Loading branch information
Ben Maurer committed Oct 3, 2004
1 parent ff10e7d commit 91b5319
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mcs/class/System.Web/System.Web.Caching/Cache.cs
Expand Up @@ -209,7 +209,7 @@ public sealed class Cache : IEnumerable {
// If we have any kind of expiration add into the CacheExpires class
if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration) {
if (objEntry.HasSlidingExpiration)
objEntry.Expires = DateTime.Now.Ticks + objEntry.SlidingExpiration;
objEntry.Expires = DateTime.UtcNow.Ticks + objEntry.SlidingExpiration;

_objExpires.Add (objEntry);
}
Expand Down Expand Up @@ -392,7 +392,7 @@ public sealed class Cache : IEnumerable {

internal CacheEntry GetEntry (string strKey) {
CacheEntry objEntry = null;
long ticksNow = DateTime.Now.Ticks;
long ticksNow = DateTime.UtcNow.Ticks;

if (strKey == null)
throw new ArgumentNullException ("strKey");
Expand Down
2 changes: 1 addition & 1 deletion mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
Expand Up @@ -100,7 +100,7 @@ internal enum Flags {
// moved after each period, and the absolute expiration is the value used
// for all expiration calculations.
if (tsSpan.Ticks != Cache.NoSlidingExpiration.Ticks)
_ticksExpires = System.DateTime.Now.AddTicks(_ticksSlidingExpiration).Ticks;
_ticksExpires = System.DateTime.UtcNow.AddTicks(_ticksSlidingExpiration).Ticks;

_objDependency = objDependency;
if (_objDependency != null)
Expand Down
4 changes: 2 additions & 2 deletions mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
Expand Up @@ -71,7 +71,7 @@ internal class CacheExpires : IDisposable {
} while (bytePos < 60);

// GC Bucket controller
_intFlush = System.DateTime.Now.Minute - 1;
_intFlush = System.DateTime.UtcNow.Minute - 1;
_objTimer = new System.Threading.Timer (new System.Threading.TimerCallback (GarbageCleanup), null, 10000, 60000);
}

Expand All @@ -80,7 +80,7 @@ internal class CacheExpires : IDisposable {
/// </summary>
/// <param name="objEntry">Cache entry to add.</param>
internal void Add (CacheEntry objEntry) {
long now = DateTime.Now.Ticks;
long now = DateTime.UtcNow.Ticks;
if (objEntry.Expires < now)
objEntry.Expires = now;

Expand Down
5 changes: 5 additions & 0 deletions mcs/class/System.Web/System.Web.Caching/ChangeLog
@@ -1,3 +1,8 @@
2004-10-03 Ben Maurer <bmaurer@ximian.com>

* Cache.cs, CacheEntry.cs, CacheExpires.cs, ExpiresBuckets.cs:
use UtcNow rather than Now.

2004-05-27 Patrik Torstensson <totte@hiddenpeaks.com>

* ExpiresBucket.cs (FlushExpiredItems): fix csc and a typo bug
Expand Down
2 changes: 1 addition & 1 deletion mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
Expand Up @@ -231,7 +231,7 @@ internal class ExpiresBucket {
int intPos;
long ticksNow;

ticksNow = DateTime.Now.Ticks;
ticksNow = DateTime.UtcNow.Ticks;

intPos = 0;
// Lookup all items that needs to be removed, this is done in a two part
Expand Down

0 comments on commit 91b5319

Please sign in to comment.