예제 #1
0
        /// <summary>
        ///   Warning,
        /// </summary>
        public override void DeleteObjectWithOid(OID oid)
        {
            var cache = GetSession().GetCache();
            // Check if oih is in the cache
            var objectInfoHeader = cache.GetObjectInfoHeaderByOid(oid, false) ??
                                   ObjectReader.ReadObjectInfoHeaderFromOid(oid, true);

            _objectWriter.Delete(objectInfoHeader);
            // removes the object from the cache
            cache.RemoveObjectByOid(objectInfoHeader.GetOid());
        }
예제 #2
0
 public async Task Delete(string objectName, CancellationToken cancellationToken)
 {
     CheckObjectName(objectName);
     await Task.WhenAll(
         _locker.Lock(cancellationToken),
         _writer.Delete(objectName, cancellationToken));
 }
예제 #3
0
        public async Task Delete(string objectName, CancellationToken cancellationToken)
        {
            try
            {
                await _inner.Delete(objectName, cancellationToken);
            }
            catch (OperationCanceledException)
            {
                throw;
            }
            catch
            {
                _writer.Add(_prefix + "delete_errors", 1);
                throw;
            }

            _writer.Add(_prefix + "deletes", 1);
        }
예제 #4
0
        public async Task Delete(string objectName, CancellationToken cancellationToken)
        {
            if (objectName is null)
            {
                throw new ArgumentNullException(nameof(objectName));
            }

            try
            {
                await _inner.Delete(objectName, cancellationToken);
            }
            catch (OperationCanceledException)
            {
                throw;
            }
#pragma warning disable CA1031 // Do not catch general exception types -- failing to delete something is not considered a real problem
            catch
#pragma warning restore CA1031 // Do not catch general exception types
            {
            }
        }