Skip to content

Commit 6d57b27

Browse files
committed
Fixed header defitinion.
1 parent 2c42f0c commit 6d57b27

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

cpp/ConnectionPool.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,15 @@ void ConnectionPool::closeAll() {
171171
std::future<void> ConnectionPool::refreshSchema() {
172172
std::vector<std::future<void>> futures;
173173

174-
// Collect the future from the write connection
175174
futures.push_back(writeConnection.refreshSchema());
176175

177-
// Collect the futures from the read connections
178176
for (unsigned int i = 0; i < maxReads; i++) {
179177
futures.push_back(readConnections[i]->refreshSchema());
180178
}
181179

182-
// Return a future that completes when all collected futures are done
183180
return std::async(std::launch::async, [futures = std::move(futures)]() mutable {
184-
for (auto& fut : futures) {
185-
fut.get(); // This will block until the future is ready and rethrow exceptions if any
181+
for (auto& future : futures) {
182+
future.get();
186183
}
187184
});
188185
}

cpp/ConnectionPool.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class ConnectionPool {
130130
/**
131131
* Refreshes the schema for all connections.
132132
*/
133-
std::future<void> ConnectionPool::refreshSchema();
133+
std::future<void> refreshSchema();
134134

135135
/**
136136
* Attaches another database to all connections

cpp/ConnectionState.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include "fileUtils.h"
33
#include "sqlite3.h"
44

5-
6-
75
const std::string EMPTY_LOCK_ID = "";
86

97
SQLiteOPResult genericSqliteOpenDb(string const dbName, string const docPath,
@@ -65,7 +63,6 @@ std::future<void> ConnectionState::refreshSchema() {
6563
return future;
6664
}
6765

68-
6966
void ConnectionState::close() {
7067
waitFinished();
7168
// So that the thread can stop (if not already)

cpp/bindings.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ void osp::install(jsi::Runtime &rt,
286286
return {};
287287
});
288288

289-
290289
auto refreshSchema = HOSTFN("refreshSchema", 1) {
291290
if (count == 0) {
292291
throw jsi::JSError(rt, "[react-native-quick-sqlite][refreshSchema] database name is required");

cpp/sqliteBridge.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ sqliteOpenDb(string const dbName, string const docPath,
6060
};
6161
}
6262

63-
6463
std::future<void> sqliteRefreshSchema(const std::string& dbName) {
6564
if (dbMap.count(dbName) == 0) {
6665
// Database not found, return a future that's already set
@@ -73,7 +72,6 @@ std::future<void> sqliteRefreshSchema(const std::string& dbName) {
7372
return connection->refreshSchema();
7473
}
7574

76-
7775
SQLiteOPResult sqliteCloseDb(string const dbName) {
7876
if (dbMap.count(dbName) == 0) {
7977
return generateNotOpenResult(dbName);

0 commit comments

Comments
 (0)