Skip to content

Commit

Permalink
fix: migration should write settings in sync mode to prevent async lo…
Browse files Browse the repository at this point in the history
…ading of old settings
  • Loading branch information
olzzon committed Mar 25, 2021
1 parent 39c9f05 commit 00e004f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion server/utils/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ const migrate45to46 = (currentSettings: ISettings): ISettings => {
)
})
currentSettings.sisyfosVersion = version
saveSettings(currentSettings)
delete currentSettings.customPages
fs.writeFileSync(
path.resolve('storage', 'settings.json'),
JSON.stringify(currentSettings),
'utf8',
(error: any) => {
logger.error(
'Migration failed - error writing settings.json file: ',
error
)
}
)
return currentSettings
}

0 comments on commit 00e004f

Please sign in to comment.