• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vposd / CachedQueries / 4055265175

pending completion
4055265175

Pull #15

github

GitHub
Merge 0046186a7 into 541d6e495
Pull Request #15: Release 1.0.16

2 of 28 branches covered (7.14%)

Branch coverage included in aggregate %.

88 of 88 new or added lines in 7 files covered. (100.0%)

19 of 182 relevant lines covered (10.44%)

0.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/CachedQueries.Core/DefaultLockManager.cs
1
using System.Collections.Concurrent;
2
using CachedQueries.Core.Interfaces;
3

4
namespace CachedQueries.Core;
5

6
public class DefaultLockManager : ILockManager
7
{
8
    private readonly ConcurrentDictionary<object, SemaphoreSlim> _locks = new();
×
9

10
    public Task CheckLockAsync(string key, CancellationToken cancellationToken = default)
11
    {
×
12
        return Task.CompletedTask;
×
13
    }
×
14

15
    public async Task LockAsync(string key, TimeSpan timespan)
16
    {
×
17
        var lockItem = _locks.GetOrAdd(key, k => new SemaphoreSlim(1, 1));
×
18
        await lockItem.WaitAsync();
×
19
    }
×
20

21
    public Task ReleaseLockAsync(string key)
22
    {
×
23
        _locks.TryGetValue(key, out var lockItem);
×
24
        lockItem?.Release();
×
25

26
        return Task.CompletedTask;
×
27
    }
×
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc