我正在使用fs.writeFile
从docker容器写入dfs。 writefile
正常工作的时间为99%,但有时会返回错误。在代码中,我创建了文件,并且不再访问它。也没有其他东西可以访问该文件。
try {
result = await this.writeFile(location, fileContent);
this.logger.info('File got released successfully');
} catch (error) {
.....
}
async writeFile(location, content) {
const self = this;
self.logger.info(`Creating the following file ${location}`);
return new Promise(function(resolve, reject) {
fs.writeFile(location, content, (err) => {
if (err) {
self.logger.error(`Error creating file in the cloud at ${location}. Error: ${err}`);
const errMsg = `Error creating file in the cloud at ${location}. Error: ${err}`;
reject(errMsg);
} else {
self.logger.info(`Successfully created ${location}`);
resolve(null);
}
});
});
}
错误:EIO:输入/输出错误,打开