From 8a530f6b3190898d9a349ed0a4b32398b7f05a58 Mon Sep 17 00:00:00 2001 From: Vincent Traag Date: Fri, 24 Apr 2026 00:22:06 +0200 Subject: [PATCH] fix: make tkindex robust to missing oodocs. --- tkindex.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tkindex.cc b/tkindex.cc index e347bd4..e58fade 100644 --- a/tkindex.cc +++ b/tkindex.cc @@ -98,7 +98,12 @@ int main(int argc, char** argv) } cout<<"Limit for documents: "< ? and verantwoordelijke != 'Tweede Kamer' and documentsoorten not like '%Kamerbrief%' and contentType != 'application/x-zip-compressed'", {limit}); - fmt::print("There are {} OODocuments in the tk database that need to be in the index\n", wantOO.size()); - - + decltype(wantDocs) wantOO; + try { + wantOO = todo.queryT("select id, titel, openbaarmakingsdatum datum, verantwoordelijke, grootte contentLength, mutatiedatumtijd bijgewerkt, 'OODocument' category, omschrijvingen as onderwerp from OODocument where datum > ? and verantwoordelijke != 'Tweede Kamer' and documentsoorten not like '%Kamerbrief%' and contentType != 'application/x-zip-compressed'", {limit}); + fmt::print("There are {} OODocuments in the tk database that need to be in the index\n", wantOO.size()); + } + catch(exception& e) { + fmt::print("Error retrieving OODocuments, perhaps the oo.sqlite3 database does not yet exist? Error was: {}\n", e.what()); + } + // query voor verslagen is ingewikkeld want we willen alleen de nieuwste versie indexeren // en sterker nog alle oude versies wissen fmt::print("Getting verslagen since {}\n", limit);