mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
new db update fix
This commit is contained in:
parent
ce573a63ab
commit
002865ed4a
3 changed files with 22 additions and 13 deletions
|
@ -278,8 +278,16 @@ function isQuestionValid(question: Question) {
|
|||
return true
|
||||
}
|
||||
|
||||
export function shouldSearchDataFile(df: DataFile, testUrl: string): Boolean {
|
||||
if (typeof df.shouldSearch === 'string' && df.shouldSearch === 'always') {
|
||||
export function shouldSearchDataFile(
|
||||
df: DataFile,
|
||||
testUrl: string,
|
||||
trueIfAlways?: Boolean
|
||||
): Boolean {
|
||||
if (
|
||||
typeof df.shouldSearch === 'string' &&
|
||||
df.shouldSearch === 'always' &&
|
||||
trueIfAlways
|
||||
) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -329,7 +337,7 @@ export function loadJSON(
|
|||
dataDir: string
|
||||
): Array<QuestionDb> {
|
||||
return dataFiles.reduce((acc, dataFile, index) => {
|
||||
const dataPath = dataDir + '/' + dataFile.path
|
||||
const dataPath = dataDir + dataFile.path
|
||||
|
||||
if (!utils.FileExists(dataPath)) {
|
||||
utils.WriteFile(JSON.stringify([]), dataPath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue