Pass network time down to Expire()

This commit is contained in:
Tim Wojtulewicz 2025-03-09 21:04:21 -07:00
parent c7503654e8
commit ebefb21c53
6 changed files with 14 additions and 11 deletions

View file

@ -234,11 +234,10 @@ OperationResult SQLite::DoErase(ValPtr key, OperationResultCallback* cb) {
* Removes any entries in the backend that have expired. Can be overridden by
* derived classes.
*/
void SQLite::DoExpire() {
void SQLite::DoExpire(double current_network_time) {
auto stmt = expire_stmt.get();
if ( auto res = CheckError(sqlite3_bind_double(stmt, 1, run_state::network_time));
res.code != ReturnCode::SUCCESS ) {
if ( auto res = CheckError(sqlite3_bind_double(stmt, 1, current_network_time)); res.code != ReturnCode::SUCCESS ) {
sqlite3_reset(stmt);
// TODO: do something with the error here?
}

View file

@ -29,7 +29,7 @@ private:
OperationResultCallback* cb = nullptr) override;
OperationResult DoGet(ValPtr key, OperationResultCallback* cb = nullptr) override;
OperationResult DoErase(ValPtr key, OperationResultCallback* cb = nullptr) override;
void DoExpire() override;
void DoExpire(double current_network_time) override;
/**
* Checks whether a status code returned by an sqlite call is a success.