mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Search speedup by: caching splitted questions/answers, and refactoring string compare algorithym
This commit is contained in:
parent
043e825302
commit
8fdc62349b
6 changed files with 152 additions and 86 deletions
|
@ -33,6 +33,7 @@ import {
|
|||
processIncomingRequest,
|
||||
logResult,
|
||||
backupData,
|
||||
writeData,
|
||||
shouldSaveDataFile,
|
||||
shouldSearchDataFile,
|
||||
loadJSON,
|
||||
|
@ -1364,6 +1365,7 @@ function GetApp(): ModuleType {
|
|||
|
||||
function deleteComment(obj, path) {
|
||||
if (path.length === 1) {
|
||||
// TODO: check if its actually deleteable by user (deleting other users comments)
|
||||
obj.splice(path[0], 1)
|
||||
} else {
|
||||
const i = path.pop()
|
||||
|
@ -1888,7 +1890,7 @@ function GetApp(): ModuleType {
|
|||
}
|
||||
|
||||
if (saveDb) {
|
||||
utils.WriteFile(JSON.stringify(currDb.data), currDb.path)
|
||||
writeData(currDb.data, currDb.path)
|
||||
msgAllWorker({
|
||||
qdbs: questionDbs,
|
||||
type: 'update',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue