Esempio n. 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.
                }
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
 void _sessionMap_Expired(object sender, ExpirationEventArgs <IoSession> e)
 {
     e.Object.Close(true);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 7
0
 private void OnExpiration(object sender, ExpirationEventArgs <CacheItem> e)
 {
     lock (_cache) {
         Delete(e.Entry.Value);
     }
 }