Skip to content

Commit c987edc

Browse files
committed
[ SQLITE ] housekeeping.
1 parent 4b8d5f8 commit c987edc

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

lib/server-process.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module.exports = function (ssbConfig) {
131131
const database = new DatabaseSync(sqliteIndexPath);
132132

133133
// create new file
134-
serverlog("creating virtual table.");
134+
serverlog("[SQLITE] creating virtual table.");
135135
database.exec(`
136136
CREATE VIRTUAL TABLE IF NOT EXISTS messages USING fts5(key, content, raw, timestamp);
137137
`);
@@ -202,7 +202,7 @@ module.exports = function (ssbConfig) {
202202
return;
203203
}
204204

205-
serverlog("SQLITE: Starting message indexing pull stream...");
205+
serverlog("[SQLITE] Starting message indexing pull stream...");
206206
const insert = database.prepare(
207207
"INSERT OR REPLACE INTO messages (key, content, raw, timestamp) VALUES (?, ?, ?, ?)",
208208
);
@@ -240,28 +240,27 @@ module.exports = function (ssbConfig) {
240240
try {
241241
insert.run(m.key, m.content, m.raw, m.timestamp);
242242
} catch (e) {
243-
serverlog("Problem inserting");
243+
serverlog("[SQLITE] Problem inserting");
244244
serverlog(JSON.stringify(m, null, 2));
245245
}
246246

247247
i++;
248-
serverlog(`last timestamp ${lastIndexedTimestamp}`);
248+
serverlog(`[SQLITE] insert. last timestamp ${lastIndexedTimestamp}`);
249249
lastIndexedTimestamp = m.timestamp;
250250
}
251251
}),
252252
);
253253
};
254254

255255
loadOrCreateSqlite().then(({ database, controlData }) => {
256-
serverlog("SQLITE: callback");
257256
let delayPullStream = false;
258257
let configuration = configurationForIdentity(ssbConfig.keys.id);
259258
if (configuration?.imported) {
260259
delayPullStream = true;
261260
}
262261
loadMessagesIntoSQLite({ database, controlData, delayPullStream });
263262
}).catch((e) => {
264-
serverlog("SQLITE: ERROR");
263+
serverlog("[SQLITE] ERROR");
265264
console.error(JSON.stringify(e));
266265
});
267266
};

0 commit comments

Comments
 (0)