Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 nodejs v14及后续版本执行 fis3 release 出错的问题 #1335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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