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

    https://github.com/apache/metron/pull/1208#discussion_r224797583
  
    --- 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 --
    
    Yes because it's already implemented. Every time the pcap panel is rendered 
(`ngOnInit` ) we ask the server whether we have a running job in the 
background. If so, we reattach the job on the UI and keep pooling the server 
until the job gets done. But it has nothing to do with what we're doing here in 
this PR.


---

Reply via email to