mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Sets responseMsToLive to zero in some dataService methods and adds ability to reset the responseMsToLive value in subclasses.
This commit is contained in:
@@ -52,7 +52,11 @@ export abstract class DataService<T extends CacheableObject> {
|
|||||||
/**
|
/**
|
||||||
* Allows subclasses to reset the response cache time.
|
* Allows subclasses to reset the response cache time.
|
||||||
*/
|
*/
|
||||||
|
<<<<<<< HEAD
|
||||||
protected responseMsToLive: number;
|
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>
|
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)))
|
first((href: string) => hasValue(href)))
|
||||||
.subscribe((href: string) => {
|
.subscribe((href: string) => {
|
||||||
const request = new FindAllRequest(this.requestService.generateRequestId(), href, options);
|
const request = new FindAllRequest(this.requestService.generateRequestId(), href, options);
|
||||||
|
<<<<<<< HEAD
|
||||||
if (hasValue(this.responseMsToLive)) {
|
if (hasValue(this.responseMsToLive)) {
|
||||||
request.responseMsToLive = 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);
|
this.requestService.configure(request);
|
||||||
});
|
});
|
||||||
@@ -160,8 +169,13 @@ export abstract class DataService<T extends CacheableObject> {
|
|||||||
find((href: string) => hasValue(href)))
|
find((href: string) => hasValue(href)))
|
||||||
.subscribe((href: string) => {
|
.subscribe((href: string) => {
|
||||||
const request = new FindByIDRequest(this.requestService.generateRequestId(), href, id);
|
const request = new FindByIDRequest(this.requestService.generateRequestId(), href, id);
|
||||||
|
<<<<<<< HEAD
|
||||||
if (hasValue(this.responseMsToLive)) {
|
if (hasValue(this.responseMsToLive)) {
|
||||||
request.responseMsToLive = 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);
|
this.requestService.configure(request);
|
||||||
});
|
});
|
||||||
@@ -171,8 +185,13 @@ export abstract class DataService<T extends CacheableObject> {
|
|||||||
|
|
||||||
findByHref(href: string, options?: HttpOptions): Observable<RemoteData<T>> {
|
findByHref(href: string, options?: HttpOptions): Observable<RemoteData<T>> {
|
||||||
const request = new GetRequest(this.requestService.generateRequestId(), href, null, options);
|
const request = new GetRequest(this.requestService.generateRequestId(), href, null, options);
|
||||||
|
<<<<<<< HEAD
|
||||||
if (hasValue(this.responseMsToLive)) {
|
if (hasValue(this.responseMsToLive)) {
|
||||||
request.responseMsToLive = 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);
|
this.requestService.configure(request);
|
||||||
return this.rdbService.buildSingle<T>(href);
|
return this.rdbService.buildSingle<T>(href);
|
||||||
|
@@ -20,11 +20,7 @@ import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class WorkflowItemDataService extends DataService<WorkflowItem> {
|
export class WorkflowItemDataService extends DataService<WorkflowItem> {
|
||||||
protected linkPath = 'workflowitems';
|
protected linkPath = 'workflowitems';
|
||||||
<<<<<<< HEAD
|
|
||||||
protected responseMsToLive = 0;
|
protected responseMsToLive = 0;
|
||||||
=======
|
|
||||||
protected resetMsToLive = true;
|
|
||||||
>>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true.
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected comparator: DSOChangeAnalyzer<WorkflowItem>,
|
protected comparator: DSOChangeAnalyzer<WorkflowItem>,
|
||||||
|
@@ -20,11 +20,7 @@ import { WorkspaceItem } from './models/workspaceitem.model';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class WorkspaceitemDataService extends DataService<WorkspaceItem> {
|
export class WorkspaceitemDataService extends DataService<WorkspaceItem> {
|
||||||
protected linkPath = 'workspaceitems';
|
protected linkPath = 'workspaceitems';
|
||||||
<<<<<<< HEAD
|
|
||||||
protected responseMsToLive = 0;
|
protected responseMsToLive = 0;
|
||||||
=======
|
|
||||||
protected resetMsToLive = true;
|
|
||||||
>>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true.
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected comparator: DSOChangeAnalyzer<WorkspaceItem>,
|
protected comparator: DSOChangeAnalyzer<WorkspaceItem>,
|
||||||
|
@@ -22,11 +22,15 @@ import { ProcessTaskResponse } from './models/process-task-response';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class ClaimedTaskDataService extends TasksService<ClaimedTask> {
|
export class ClaimedTaskDataService extends TasksService<ClaimedTask> {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
protected responseMsToLive = 0;
|
protected responseMsToLive = 0;
|
||||||
=======
|
=======
|
||||||
protected resetMsToLive = true;
|
protected resetMsToLive = true;
|
||||||
>>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously 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
|
* The endpoint link name
|
||||||
|
@@ -27,6 +27,7 @@ export class PoolTaskDataService extends TasksService<PoolTask> {
|
|||||||
*/
|
*/
|
||||||
protected linkPath = 'pooltasks';
|
protected linkPath = 'pooltasks';
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
protected responseMsToLive = 0;
|
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.
|
>>>>>>> Refactored to remove forceBypassCache param from requestService and from data service classes.
|
||||||
=======
|
=======
|
||||||
protected resetMsToLive = true;
|
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.
|
>>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true.
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user