mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-01 20:43:47 +00:00
meas: Do not retry to close the database
There is no concurrency involved and if it failed the first time, it will fail the second, third, ... time as well. Simply print that we will leak the database instance.
This commit is contained in:
@@ -314,7 +314,6 @@ err_io:
|
||||
|
||||
void meas_db_close(struct meas_db_state *st)
|
||||
{
|
||||
int retries;
|
||||
if (sqlite3_finalize(st->stmt_ins_mr) != SQLITE_OK)
|
||||
fprintf(stderr, "DB insert measurement report finalize error: %s\n",
|
||||
sqlite3_errmsg(st->db));
|
||||
@@ -324,16 +323,8 @@ void meas_db_close(struct meas_db_state *st)
|
||||
if (sqlite3_finalize(st->stmt_upd_mr) != SQLITE_OK)
|
||||
fprintf(stderr, "DB update measurement report finalize error: %s\n",
|
||||
sqlite3_errmsg(st->db));
|
||||
retries = 0;
|
||||
while (1) {
|
||||
if (sqlite3_close(st->db) == SQLITE_OK)
|
||||
break;
|
||||
if ((++retries) >= 3) {
|
||||
fprintf(stderr, "Unable to close DB, abandoning.\n");
|
||||
break;
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
if (sqlite3_close(st->db) != SQLITE_OK)
|
||||
fprintf(stderr, "Unable to close DB, abandoning.\n");
|
||||
|
||||
talloc_free(st);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user