Project

General

Profile

« Previous | Next » 

Revision 61262

[Trunk | Library]:
1. timeout-interceptor.service.ts: Added whitelist, so that urls included in the list are not cut by this timeout interceptor.
2. services/reports.service.ts & landingPages/htmlProjectReport/htmlProjectReport.service.ts: In calls for CSV and HTML reports, added timeout 10 in seconds.
3. organization.component.ts: Created array "innerReportSubscriptions" where inner request of "downloading research results of a funder" are added - on error, all innerReportSubscriptions are unsubscribed.

View differences:

reports.service.ts
4 4

  
5 5

  
6 6

  
7
import {map, tap} from "rxjs/operators";
7
import {map, tap, timeout} from "rxjs/operators";
8 8

  
9 9
@Injectable()
10 10
export class ReportsService {
......
16 16
     //var headers = new Headers();
17 17
     //headers.append('responseType', 'arraybuffer');
18 18
     return this.http.get(url, {responseType: 'text'})
19
                .pipe(map(res => new Blob([res], { type: 'text/csv' })));
19
                .pipe(
20
                  timeout(10000),
21
                  map(res => new Blob([res], { type: 'text/csv' })));
20 22
   }
21 23
   getCSVResponse(url: string){
22 24
     //var headers = new Headers();
23 25
     //headers.append('responseType', 'arraybuffer');
24
     return this.http.get(url, {responseType: 'text'});
26
     return this.http.get(url, {responseType: 'text'})
27
                .pipe(timeout(10000));
25 28
                //.pipe(map(res => res));
26 29
   }
27 30

  

Also available in: Unified diff