Skip to content

Commit 15cf08d

Browse files
committed
update acquire lock dotnet
Signed-off-by: Hannah Hunter <[email protected]>
1 parent 6d3f537 commit 15cf08d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

daprdocs/content/en/developing-applications/building-blocks/distributed-lock/howto-use-distributed-lock.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ namespace LockService
6262
{
6363
class Program
6464
{
65+
[Obsolete("Distributed Lock API is in Alpha, this can be removed once it is stable.")]
6566
static async Task Main(string[] args)
6667
{
6768
string DAPR_LOCK_NAME = "lockstore";
69+
string fileName = "my_file_name";
6870
var client = new DaprClientBuilder().Build();
69-
70-
using (var fileLock = await client.Lock(DAPR_LOCK_NAME, "my_file_name", "random_id_abc123", 60))
71+
72+
await using (var fileLock = await client.Lock(DAPR_LOCK_NAME, fileName, "random_id_abc123", 60))
7173
{
7274
if (fileLock.Success)
7375
{

0 commit comments

Comments
 (0)