From 4042ac58de7e644f5981688acd5fc298996771fa Mon Sep 17 00:00:00 2001 From: Ilya Repin Date: Thu, 29 Jan 2026 11:50:35 +0000 Subject: [PATCH] add data and force args --- ydb/include/userver/ydb/coordination.hpp | 4 ++-- ydb/src/ydb/coordination.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ydb/include/userver/ydb/coordination.hpp b/ydb/include/userver/ydb/coordination.hpp index 016f5d11c59f..1239aacbce4d 100644 --- a/ydb/include/userver/ydb/coordination.hpp +++ b/ydb/include/userver/ydb/coordination.hpp @@ -61,13 +61,13 @@ class CoordinationSession final { ); /// Create semaphore - void CreateSemaphore(std::string_view name, std::uint64_t limit); + void CreateSemaphore(std::string_view name, std::uint64_t limit, std::string_view data = {}); /// Update semaphore void UpdateSemaphore(std::string_view name, std::string_view data); /// Delete semaphore - void DeleteSemaphore(std::string_view name); + void DeleteSemaphore(std::string_view name, bool force = false); private: NYdb::NCoordination::TSession session_; diff --git a/ydb/src/ydb/coordination.cpp b/ydb/src/ydb/coordination.cpp index 178f6b24a4c2..acb232b99a06 100644 --- a/ydb/src/ydb/coordination.cpp +++ b/ydb/src/ydb/coordination.cpp @@ -56,16 +56,16 @@ NYdb::NCoordination::TSemaphoreDescription CoordinationSession::DescribeSemaphor return ExtractResult(session_.DescribeSemaphore(impl::ToString(name), settings), "DescribeSemaphore"); } -void CoordinationSession::CreateSemaphore(std::string_view name, std::uint64_t limit) { - ExtractResult(session_.CreateSemaphore(impl::ToString(name), limit), "CreateSemaphore"); +void CoordinationSession::CreateSemaphore(std::string_view name, std::uint64_t limit, std::string_view data) { + ExtractResult(session_.CreateSemaphore(impl::ToString(name), limit, impl::ToString(data)), "CreateSemaphore"); } void CoordinationSession::UpdateSemaphore(std::string_view name, std::string_view data) { ExtractResult(session_.UpdateSemaphore(impl::ToString(name), impl::ToString(data)), "UpdateSemaphore"); } -void CoordinationSession::DeleteSemaphore(std::string_view name) { - ExtractResult(session_.DeleteSemaphore(impl::ToString(name)), "DeleteSemaphore"); +void CoordinationSession::DeleteSemaphore(std::string_view name, bool force) { + ExtractResult(session_.DeleteSemaphore(impl::ToString(name), force), "DeleteSemaphore"); } CoordinationClient::CoordinationClient(std::shared_ptr driver)