You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by nickwallen <gi...@git.apache.org> on 2018/10/10 15:02:39 UTC

[GitHub] metron pull request #1208: METRON-1790: Unsubscribe from every observable in...

Github user nickwallen commented on a diff in the pull request:

    https://github.com/apache/metron/pull/1208#discussion_r224110745
  
    --- Diff: metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts ---
    @@ -81,26 +81,28 @@ export class PcapPanelComponent implements OnInit, OnDestroy {
         this.pdml = null;
         this.progressWidth = 0;
         this.errorMsg = null;
    -    this.submitSubscription = this.pcapService.submitRequest(pcapRequest).subscribe((submitResponse: PcapStatusResponse) => {
    -      let id = submitResponse.jobId;
    -      if (!id) {
    -        this.errorMsg = submitResponse.description;
    -        this.queryRunning = false;
    -      } else {
    -        this.startPolling(id);
    +    this.subscriptions['submitSubscription'] = this.pcapService.submitRequest(pcapRequest).subscribe(
    +      (submitResponse: PcapStatusResponse) => {
    +        let id = submitResponse.jobId;
    +        if (!id) {
    +          this.errorMsg = submitResponse.description;
    +          this.queryRunning = false;
    +        } else {
    +          this.startPolling(id);
    +        }
    +      }, (error: any) => {
    +        this.errorMsg = `Response message: ${error.message}. Something went wrong with your query submission!`;
    --- End diff --
    
    Why do we not need to unsubscribe here like we do for 'statusSubscription' and 'cancelSubscription'?
    ```
    this.subscriptions['submitSubscription'].unsubscribe();
    ```


---