Skip to content

Conversation

@lienjun
Copy link

@lienjun lienjun commented Dec 23, 2022

fs.writeFileSync(path, data) 在 nodejs v14及后续版本中有相关的调整,(https://nodejs.org/docs/latest-v14.x/api/fs.html#fs_fs_writefilesync_file_data_options),这会导致fis3 release 在缓存 fis-conf.js 文件时、fis3 server start 在保存 pid 时出现错误,本次变更用于修复这些错误。

fs.writeFileSync(path, data) 在 nodejs v14及后续版本中有相关的调整,(https://nodejs.org/docs/latest-v14.x/api/fs.html#fs_fs_writefilesync_file_data_options),这会导致fis3 release 在缓存 fis-conf.js 文件时、fis3 server start 在保存 pid 时出现错误,本次变更用于修复这些错误。
@nice2meu
Copy link

nice2meu commented Dec 23, 2022 via email

@lienjun
Copy link
Author

lienjun commented Dec 23, 2022

对于未发布新版本前的临时处理方案,可以在 fis-conf.js 中添加以下代码:

const originalWrite = fis.util.write;
fis.util.write = function(path, data, charset, append) {
    if (data === undefined || data === null || typeof data === 'number') {
        data += '';
    }
    originalWrite(path, data, charset, append);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants