Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit maximum number of logged errors #122

Merged
merged 2 commits into from Aug 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions database.c
Expand Up @@ -329,7 +329,15 @@ void save_to_DB(void)
if( rc != SQLITE_DONE ){
logg("save_to_DB() - SQL error (%i): %s", rc, sqlite3_errmsg(db));
saved_error++;
continue;
if(saved_error < 3)
{
continue;
}
else
{
logg("save_to_DB() - exiting due to too many errors");
break;
}
}

saved++;
Expand Down Expand Up @@ -359,10 +367,9 @@ void save_to_DB(void)

if(debug)
{
if(saved > 0)
logg("Notice: Queries stored in DB: %u", saved);
logg("Notice: Queries stored in DB: %u", saved);
if(saved_error > 0)
logg(" Queries NOT stored in DB: %u (due to an error)", saved_error);
logg(" There are queries that have not been saved");
}
}

Expand Down