public async revoke()

in src/lease.ts [173:189]


  public async revoke(options: grpc.CallOptions | undefined = this.defaultOptions): Promise<void> {
    this.close();

    const id = await this.leaseID;
    if (id instanceof Error) {
      // if an error, we didn't grant in the first place
      return;
    }

    try {
      await this.client.leaseRevoke({ ID: id }, options);
    } catch (e) {
      if (!(e instanceof EtcdLeaseInvalidError)) {
        throw e;
      }
    }
  }