流星方法等待不存在的订阅

时间:2016-12-06 05:41:25

标签: meteor meteor-methods kadira

我有一个Meteor方法generateUserHash,只需将ID传递给Intercom即可获取用户哈希:

export const generateUserHash = new ValidatedMethod({
  name: 'generateUserHash',

  validate() {},

  run() {
    if (!Meteor.isServer) return;

    if (!this.userId) throw new Meteor.Error('no-user-id');

    return SecureMode.userHash({
      identifier: this.userId,
      secretKey: Meteor.settings.intercom.secretKey,
    });
  },
});

根据卡迪拉的说法:

enter image description here

我不明白为什么它会等待所有这些订阅,因为这些订阅中没有任何内容。

1 个答案:

答案 0 :(得分:0)

即使订阅不在该方法中,方法也会等待订阅。

关于等待时间的好帖子在这里:https://meteorhacks.com/understanding-meteor-wait-time-and-this-unblock/