mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix data-race with ReturnCode objects in Sqlite::DoExpire
This commit is contained in:
parent
8b9fe48f13
commit
a67e138d4e
1 changed files with 10 additions and 4 deletions
|
@ -237,12 +237,18 @@ OperationResult SQLite::DoErase(ResultCallback* cb, ValPtr key) {
|
||||||
void SQLite::DoExpire(double current_network_time) {
|
void SQLite::DoExpire(double current_network_time) {
|
||||||
auto stmt = expire_stmt.get();
|
auto stmt = expire_stmt.get();
|
||||||
|
|
||||||
if ( auto res = CheckError(sqlite3_bind_double(stmt, 1, current_network_time)); res.code != ReturnCode::SUCCESS ) {
|
int status = sqlite3_bind_double(stmt, 1, current_network_time);
|
||||||
sqlite3_reset(stmt);
|
if ( status != SQLITE_OK ) {
|
||||||
// TODO: do something with the error here?
|
// TODO: do something with the error?
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
status = sqlite3_step(stmt);
|
||||||
|
if ( status != SQLITE_ROW ) {
|
||||||
|
// TODO: should this return an error somehow? Reporter warning?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Step(stmt, false);
|
sqlite3_reset(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true in case of error
|
// returns true in case of error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue