Nodejs Client for FastDFS 使用中的遇到的问题

傷城~ 2022-04-05 15:35 323阅读 0赞

#使用获取storage信息函数

  1. fdfs.listStorages('group1').then(function(storages) {
  2. console.log(storages);
  3. }).catch(function(err) {
  4. console.error(err);
  5. });

#报错

  1. (node:6560) Warning: a promise was rejected with a non-error: [object String]
  2. byte array length:612 is invalid!

#暂时解决办法
_fdfs@1.0.4@fdfs/lib/tracker.js 280行 修改为

  1. if (body.length % 612 != 0) {
  2. reject('byte array length:' + body.length + ' is invalid!');
  3. return;
  4. }
  5. var res = {
  6. count: body.length / 612,
  7. storages: []
  8. };

原文内容来自我的私人博客会不断更新

发表评论

表情:
评论列表 (有 0 条评论,323人围观)

还没有评论,来说两句吧...

相关阅读