示例#1
0
        private void OnDelete(object sender, ExpirationEventArgs <string> e)
        {
            var filepathEntry = e.Entry;

            if (filepathEntry.When > GlobalClock.UtcNow)
            {
                _log.DebugFormat("Ignoring premature expiration event for '{0}' scheduled for '{1}'", filepathEntry.Value, filepathEntry.When);
                return;
            }
            var metaPath = GetMetaPath(filepathEntry.Value);

            if (File.Exists(filepathEntry.Value))
            {
                try {
                    File.Delete(filepathEntry.Value);
                } catch {
                    // ignore file deletion exception

                    // BUG #806: we should try again in a few seconds; however, we need to be smart about it and count how often
                    //           we tried, otherwise we run the risk of bogging down the system b/c we're attempting to delete undeletable files.
                }
            }
            if (File.Exists(metaPath))
            {
                try {
                    File.Delete(metaPath);
                } catch {
                    // ignore file deletion exception

                    // BUG #806: we should try again in a few seconds; however, we need to be smart about it and count how often
                    //           we tried, otherwise we run the risk of bogging down the system b/c we're attempting to delete undeletable files.
                }
            }
        }
示例#2
0
        private void OnDelete(object sender, ExpirationEventArgs <string> e)
        {
            var filepathEntry = e.Entry;

            if (filepathEntry.When > DateTime.UtcNow)
            {
                _log.DebugFormat("Ignoring premature expiration event for '{0}' scheduled for '{1}'", filepathEntry.Value, filepathEntry.When);
                return;
            }
            DeleteFile(filepathEntry.Value);
        }
 void _sessionMap_Expired(object sender, ExpirationEventArgs <IoSession> e)
 {
     e.Object.Close(true);
 }
示例#4
0
 private void OnDelete(object sender, ExpirationEventArgs<string> e)
 {
     var filepathEntry = e.Entry;
     if(filepathEntry.When > DateTime.UtcNow) {
         _log.DebugFormat("Ignoring premature expiration event for '{0}' scheduled for '{1}'", filepathEntry.Value, filepathEntry.When);
         return;
     }
     DeleteFile(filepathEntry.Value);
 }
示例#5
0
        private void OnDelete(object sender, ExpirationEventArgs<string> e)
        {
            var filepathEntry = e.Entry;
            if(filepathEntry.When > DateTime.UtcNow) {
                _log.DebugFormat("Ignoring premature expiration event for '{0}' scheduled for '{1}'", filepathEntry.Value, filepathEntry.When);
                return;
            }
            var metaPath = GetMetaPath(filepathEntry.Value);
            if(File.Exists(filepathEntry.Value)) {
                try {
                    File.Delete(filepathEntry.Value);
                } catch {
                    // ignore file deletion exception

                    // BUG #806: we should try again in a few seconds; however, we need to be smart about it and count how often
                    //           we tried, otherwise we run the risk of bogging down the system b/c we're attempting to delete undeletable files.
                }
            }
            if(File.Exists(metaPath)) {
                try {
                    File.Delete(metaPath);
                } catch {
                    // ignore file deletion exception

                    // BUG #806: we should try again in a few seconds; however, we need to be smart about it and count how often
                    //           we tried, otherwise we run the risk of bogging down the system b/c we're attempting to delete undeletable files.
                }
            }
        }
 void _sessionMap_Expired(object sender, ExpirationEventArgs<IoSession> e)
 {
     e.Object.Close(true);
 }
示例#7
0
 private void OnExpiration(object sender, ExpirationEventArgs <CacheItem> e)
 {
     lock (_cache) {
         Delete(e.Entry.Value);
     }
 }