ssb: Log all the query timing.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
2025-11-16 11:59:18 -05:00
parent bb75edfd42
commit 3c1f60b62d
3 changed files with 8 additions and 13 deletions

View File

@@ -52,10 +52,13 @@ tfrpc.register(async function closeConnection(id) {
await ssb.closeConnection(id);
});
tfrpc.register(async function query(sql, args) {
let start = new Date();
let result = [];
await ssb.sqlAsync(sql, args, function callback(row) {
result.push(row);
});
let end = new Date();
print((end - start) / 1000, sql.replaceAll(/\s+/g, ' ').trim());
return result;
});
tfrpc.register(async function appendMessage(id, message) {