mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
not failing on invalid p2p files
This commit is contained in:
@@ -435,15 +435,29 @@ function setup(data: SubmoduleData): Submodule {
|
||||
fname: paths.peersFile,
|
||||
logMsg: 'Peers file updated',
|
||||
action: () => {
|
||||
peers = utils.ReadJSON(paths.peersFile)
|
||||
try {
|
||||
peers = utils.ReadJSON(paths.peersFile)
|
||||
} catch (e) {
|
||||
logger.Log(
|
||||
`Peers file contents are invalid! Check if syntax is correct for ${paths.peersFile}`,
|
||||
'redbg'
|
||||
)
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
fname: paths.selfInfoFile,
|
||||
logMsg: 'P2P self info file changed',
|
||||
action: () => {
|
||||
selfInfo = utils.ReadJSON(paths.selfInfoFile)
|
||||
selfInfo.publicKey = publicKey
|
||||
try {
|
||||
selfInfo = utils.ReadJSON(paths.selfInfoFile)
|
||||
selfInfo.publicKey = publicKey
|
||||
} catch (e) {
|
||||
logger.Log(
|
||||
`Self info file contents are invalid! Check if syntax is correct for ${paths.selfInfoFile}`,
|
||||
'redbg'
|
||||
)
|
||||
}
|
||||
},
|
||||
},
|
||||
]
|
||||
|
@@ -24,6 +24,7 @@ export const validateFiles = (): boolean => {
|
||||
Object.entries(files).forEach(([key, file]: [string, FileDescriptor]) => {
|
||||
let fileExists = utils.FileExists(file.path)
|
||||
if (file.defaultValue != null && !fileExists) {
|
||||
// FIXME: create path too
|
||||
utils.WriteFile(file.defaultValue, file.path)
|
||||
fileExists = true
|
||||
}
|
||||
|
Submodule submodules/qmining-data-editor updated: 39dfd7a0f4...5a665bc766
Submodule submodules/qmining-page updated: f82ecaa6d0...7386dcaa68
Reference in New Issue
Block a user