From 934f5a1bd0254870e22a04a25b2cf11e9d1e9254 Mon Sep 17 00:00:00 2001 From: Michael W Spalti <mspalti@gmail.com> Date: Mon, 16 Sep 2019 10:00:45 -0700 Subject: [PATCH] Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses. --- src/app/core/data/data.service.ts | 19 +++++++++++++++++++ .../submission/workflowitem-data.service.ts | 4 ---- .../submission/workspaceitem-data.service.ts | 4 ---- .../core/tasks/claimed-task-data.service.ts | 4 ++++ src/app/core/tasks/pool-task-data.service.ts | 4 ++++ 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index 8362358d61..9c6eda0793 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -52,7 +52,11 @@ export abstract class DataService<T extends CacheableObject> { /** * Allows subclasses to reset the response cache time. */ +<<<<<<< HEAD protected responseMsToLive: number; +======= + protected resetMsToLive: number; +>>>>>>> Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses. public abstract getBrowseEndpoint(options: FindAllOptions, linkPath?: string): Observable<string> @@ -134,8 +138,13 @@ export abstract class DataService<T extends CacheableObject> { first((href: string) => hasValue(href))) .subscribe((href: string) => { const request = new FindAllRequest(this.requestService.generateRequestId(), href, options); +<<<<<<< HEAD if (hasValue(this.responseMsToLive)) { request.responseMsToLive = this.responseMsToLive; +======= + if (this.resetMsToLive) { + request.responseMsToLive = this.resetMsToLive; +>>>>>>> Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses. } this.requestService.configure(request); }); @@ -160,8 +169,13 @@ export abstract class DataService<T extends CacheableObject> { find((href: string) => hasValue(href))) .subscribe((href: string) => { const request = new FindByIDRequest(this.requestService.generateRequestId(), href, id); +<<<<<<< HEAD if (hasValue(this.responseMsToLive)) { request.responseMsToLive = this.responseMsToLive; +======= + if (this.resetMsToLive) { + request.responseMsToLive = this.resetMsToLive; +>>>>>>> Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses. } this.requestService.configure(request); }); @@ -171,8 +185,13 @@ export abstract class DataService<T extends CacheableObject> { findByHref(href: string, options?: HttpOptions): Observable<RemoteData<T>> { const request = new GetRequest(this.requestService.generateRequestId(), href, null, options); +<<<<<<< HEAD if (hasValue(this.responseMsToLive)) { request.responseMsToLive = this.responseMsToLive; +======= + if (this.resetMsToLive) { + request.responseMsToLive = this.resetMsToLive; +>>>>>>> Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses. } this.requestService.configure(request); return this.rdbService.buildSingle<T>(href); diff --git a/src/app/core/submission/workflowitem-data.service.ts b/src/app/core/submission/workflowitem-data.service.ts index 4e65b5c58c..218de9c81a 100644 --- a/src/app/core/submission/workflowitem-data.service.ts +++ b/src/app/core/submission/workflowitem-data.service.ts @@ -20,11 +20,7 @@ import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; @Injectable() export class WorkflowItemDataService extends DataService<WorkflowItem> { protected linkPath = 'workflowitems'; -<<<<<<< HEAD protected responseMsToLive = 0; -======= - protected resetMsToLive = true; ->>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true. constructor( protected comparator: DSOChangeAnalyzer<WorkflowItem>, diff --git a/src/app/core/submission/workspaceitem-data.service.ts b/src/app/core/submission/workspaceitem-data.service.ts index 4bf44e8764..70e07edd5e 100644 --- a/src/app/core/submission/workspaceitem-data.service.ts +++ b/src/app/core/submission/workspaceitem-data.service.ts @@ -20,11 +20,7 @@ import { WorkspaceItem } from './models/workspaceitem.model'; @Injectable() export class WorkspaceitemDataService extends DataService<WorkspaceItem> { protected linkPath = 'workspaceitems'; -<<<<<<< HEAD protected responseMsToLive = 0; -======= - protected resetMsToLive = true; ->>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true. constructor( protected comparator: DSOChangeAnalyzer<WorkspaceItem>, diff --git a/src/app/core/tasks/claimed-task-data.service.ts b/src/app/core/tasks/claimed-task-data.service.ts index 5af62318d3..31d6448a1a 100644 --- a/src/app/core/tasks/claimed-task-data.service.ts +++ b/src/app/core/tasks/claimed-task-data.service.ts @@ -22,11 +22,15 @@ import { ProcessTaskResponse } from './models/process-task-response'; @Injectable() export class ClaimedTaskDataService extends TasksService<ClaimedTask> { +<<<<<<< HEAD <<<<<<< HEAD protected responseMsToLive = 0; ======= protected resetMsToLive = true; >>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true. +======= + protected resetMsToLive = 0; +>>>>>>> Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses. /** * 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 6ceb3915de..77fff02618 100644 --- a/src/app/core/tasks/pool-task-data.service.ts +++ b/src/app/core/tasks/pool-task-data.service.ts @@ -27,6 +27,7 @@ export class PoolTaskDataService extends TasksService<PoolTask> { */ protected linkPath = 'pooltasks'; +<<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD protected responseMsToLive = 0; @@ -35,6 +36,9 @@ export class PoolTaskDataService extends TasksService<PoolTask> { >>>>>>> Refactored to remove forceBypassCache param from requestService and from data service classes. ======= protected resetMsToLive = true; +======= + protected resetMsToLive = 0; +>>>>>>> Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses. >>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true. /** -- GitLab