summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse-api/service/maintenanceimpl.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/gentoobrowse-api/service/maintenanceimpl.cpp b/gentoobrowse-api/service/maintenanceimpl.cpp
index 495e908..2bb43af 100644
--- a/gentoobrowse-api/service/maintenanceimpl.cpp
+++ b/gentoobrowse-api/service/maintenanceimpl.cpp
@@ -137,16 +137,20 @@ namespace Gentoo {
boost::filesystem::create_symlink(p, tmp / n);
});
dbc->execute(sql::maintenance::fileListCreateRaw.getSql());
- auto i = dbc->modify("INSERT INTO filelistraw(filename, filesize, filemtime) VALUES(?, ?, ?)");
+ dbc->beginBulkUpload("filelistraw", "");
+ char buf[BUFSIZ];
for (boost::filesystem::recursive_directory_iterator d(tmp, boost::filesystem::symlink_option::recurse);
d != boost::filesystem::recursive_directory_iterator(); d++) {
if (boost::filesystem::is_regular_file(d->status())) {
- i->bindParamS(0, d->path().lexically_relative(tmp).string());
- i->bindParamI(1, boost::filesystem::file_size(*d));
- i->bindParamT(2, boost::posix_time::from_time_t(boost::filesystem::last_write_time(*d)));
- i->execute();
+ auto len = snprintf(buf, BUFSIZ, "%s\t%ld\t%s\n",
+ d->path().lexically_relative(tmp).c_str(),
+ boost::filesystem::file_size(*d),
+ boost::posix_time::to_iso_extended_string(
+ boost::posix_time::from_time_t(boost::filesystem::last_write_time(*d))).c_str());
+ dbc->bulkUploadData(buf, len);
}
}
+ dbc->endBulkUpload(nullptr);
}
void