File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 1+ .
Original file line number Diff line number Diff line change 22#include " duckdb/common/file_system.hpp"
33#include " flock/secret_manager/secret_manager.hpp"
44#include < chrono>
5+ #include < thread>
56#include < fmt/format.h>
67
78namespace flock {
@@ -144,11 +145,7 @@ bool Config::StorageAttachmentGuard::TryDetach() {
144145}
145146
146147void Config::StorageAttachmentGuard::Wait (int milliseconds) {
147- auto start = std::chrono::steady_clock::now ();
148- auto duration = std::chrono::milliseconds (milliseconds);
149- while (std::chrono::steady_clock::now () - start < duration) {
150- // Busy-wait until the specified duration has elapsed
151- }
148+ std::this_thread::sleep_for (std::chrono::milliseconds (milliseconds));
152149}
153150
154151Config::StorageAttachmentGuard::StorageAttachmentGuard (duckdb::Connection& con, bool read_only)
@@ -201,11 +198,7 @@ bool Config::StorageAttachmentGuard::TryDetach() {
201198}
202199
203200void Config::StorageAttachmentGuard::Wait (int milliseconds) {
204- auto start = std::chrono::steady_clock::now ();
205- auto duration = std::chrono::milliseconds (milliseconds);
206- while (std::chrono::steady_clock::now () - start < duration) {
207- // Busy-wait until the specified duration has elapsed
208- }
201+ std::this_thread::sleep_for (std::chrono::milliseconds (milliseconds));
209202}
210203
211204Config::StorageAttachmentGuard::StorageAttachmentGuard (duckdb::Connection& con, bool read_only)
You can’t perform that action at this time.
0 commit comments