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

    https://github.com/apache/metron/pull/1208#discussion_r224353374
  
    --- Diff: 
metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts 
---
    @@ -35,40 +35,40 @@ export class PcapPanelComponent implements OnInit, 
OnDestroy {
       pdml: Pdml = null;
       pcapRequest: PcapRequest;
       resetPaginationForSearch: boolean;
    -
    -  statusSubscription: Subscription;
    -  cancelSubscription: Subscription;
    -  submitSubscription: Subscription;
    -  getSubscription: Subscription;
       queryRunning = false;
       queryId: string;
       progressWidth = 0;
       pagination: PcapPagination = new PcapPagination();
       savedPcapRequest: {};
       errorMsg: string;
       cancelConfirmMessage = 'Are you sure want to cancel the running query?';
    +  subscriptions: {
    +    [key: string]: Subscription
    +  } = {};
     
       constructor(private pcapService: PcapService) { }
     
       ngOnInit() {
         this.pcapRequest = new PcapRequest();
    -    this.pcapService.getRunningJob().subscribe((statusResponses: 
PcapStatusResponse[]) => {
    +    this.subscriptions['runningJobSubscription'] = 
this.pcapService.getRunningJob().subscribe((statusResponses: 
PcapStatusResponse[]) => {
    --- End diff --
    
    We do here: 
https://github.com/ruffle1986/metron/blob/METRON-1790/metron-interface/metron-alerts/src/app/pcap/pcap-panel/pcap-panel.component.ts#L138-L143
    
    I collect every subscription in an object and I go through all of them in 
the `unsubscribeAll` method.


---

Reply via email to