diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index ae7fccc91b..dcba9f1643 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -49,7 +49,10 @@ export abstract class DataService { protected abstract notificationsService: NotificationsService; protected abstract http: HttpClient; protected abstract comparator: ChangeAnalyzer; - protected resetMsToLive = false; + /** + * Allows subclasses to reset the response cache time. + */ + protected resetMsToLive: number; public abstract getBrowseEndpoint(options: FindAllOptions, linkPath?: string): Observable @@ -132,7 +135,7 @@ export abstract class DataService { .subscribe((href: string) => { const request = new FindAllRequest(this.requestService.generateRequestId(), href, options); if (this.resetMsToLive) { - request.responseMsToLive = 0; + request.responseMsToLive = this.resetMsToLive; } this.requestService.configure(request); }); @@ -158,7 +161,7 @@ export abstract class DataService { .subscribe((href: string) => { const request = new FindByIDRequest(this.requestService.generateRequestId(), href, id); if (this.resetMsToLive) { - request.responseMsToLive = 0; + request.responseMsToLive = this.resetMsToLive; } this.requestService.configure(request); }); @@ -169,7 +172,7 @@ export abstract class DataService { findByHref(href: string, options?: HttpOptions): Observable> { const request = new GetRequest(this.requestService.generateRequestId(), href, null, options); if (this.resetMsToLive) { - request.responseMsToLive = 0; + request.responseMsToLive = this.resetMsToLive; } this.requestService.configure(request); return this.rdbService.buildSingle(href); diff --git a/src/app/core/submission/workflowitem-data.service.ts b/src/app/core/submission/workflowitem-data.service.ts index dca10d2b30..b641531892 100644 --- a/src/app/core/submission/workflowitem-data.service.ts +++ b/src/app/core/submission/workflowitem-data.service.ts @@ -20,7 +20,7 @@ import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; @Injectable() export class WorkflowItemDataService extends DataService { protected linkPath = 'workflowitems'; - protected resetMsToLive = true; + protected resetMsToLive = 0; constructor( protected comparator: DSOChangeAnalyzer, diff --git a/src/app/core/submission/workspaceitem-data.service.ts b/src/app/core/submission/workspaceitem-data.service.ts index c2b6ab5816..b49cb065bd 100644 --- a/src/app/core/submission/workspaceitem-data.service.ts +++ b/src/app/core/submission/workspaceitem-data.service.ts @@ -20,7 +20,7 @@ import { WorkspaceItem } from './models/workspaceitem.model'; @Injectable() export class WorkspaceitemDataService extends DataService { protected linkPath = 'workspaceitems'; - protected resetMsToLive = true; + protected resetMsToLive = 0; constructor( protected comparator: DSOChangeAnalyzer, diff --git a/src/app/core/tasks/claimed-task-data.service.ts b/src/app/core/tasks/claimed-task-data.service.ts index aa85b3e8b5..546c4343b6 100644 --- a/src/app/core/tasks/claimed-task-data.service.ts +++ b/src/app/core/tasks/claimed-task-data.service.ts @@ -22,7 +22,7 @@ import { ProcessTaskResponse } from './models/process-task-response'; @Injectable() export class ClaimedTaskDataService extends TasksService { - protected resetMsToLive = true; + protected resetMsToLive = 0; /** * The endpoint link name diff --git a/src/app/core/tasks/pool-task-data.service.ts b/src/app/core/tasks/pool-task-data.service.ts index 8a12af0b68..ee3568e585 100644 --- a/src/app/core/tasks/pool-task-data.service.ts +++ b/src/app/core/tasks/pool-task-data.service.ts @@ -27,7 +27,7 @@ export class PoolTaskDataService extends TasksService { */ protected linkPath = 'pooltasks'; - protected resetMsToLive = true; + protected resetMsToLive = 0; /** * Initialize instance variables