Ignore:
Timestamp:
Jun 23, 2010, 2:04:44 PM (11 years ago)
Author:
Paul Lelgemann
Message:

o Work on the distributed KeySearcher cache

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/P2P/Tree/Leaf.cs

    r1674 r1693  
    1111    {
    1212        internal DateTime LastReservationDate;
     13        private bool isLeafReserved;
    1314
    1415        public Leaf(StorageHelper storageHelper, KeyQualityHelper keyQualityHelper, Node parentNode, BigInteger id, string distributedJobIdentifier)
     
    4748        }
    4849
     50        public override void UpdateCache()
     51        {
     52            var dateFiveMinutesBefore = DateTime.UtcNow.Subtract(new TimeSpan(0, 5, 0));
     53            isLeafReserved = dateFiveMinutesBefore < LastReservationDate;
     54        }
     55
    4956        public bool ReserveLeaf()
    5057        {
     
    5562        public override bool IsReserverd()
    5663        {
    57             var dateFiveMinutesBefore = DateTime.UtcNow.Subtract(new TimeSpan(0, 5, 0));
    58             var isReserverd = dateFiveMinutesBefore < LastReservationDate;
    59             return isReserverd;
     64            return isLeafReserved;
    6065        }
    6166
Note: See TracChangeset for help on using the changeset viewer.