mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
increased responseMsToLive from 0 to 10s, to prevent infinite loops
This commit is contained in:

committed by
Michael W Spalti

parent
70a5e271f4
commit
040692455e
@@ -45,7 +45,7 @@ export class AuthRequestService {
|
||||
distinctUntilChanged(),
|
||||
map((endpointURL: string) => new AuthPostRequest(this.requestService.generateRequestId(), endpointURL, body, options)),
|
||||
map ((request: PostRequest) => {
|
||||
request.responseMsToLive = 0;
|
||||
request.responseMsToLive = 10 * 1000;
|
||||
return request;
|
||||
}),
|
||||
tap((request: PostRequest) => this.requestService.configure(request)),
|
||||
@@ -60,7 +60,7 @@ export class AuthRequestService {
|
||||
distinctUntilChanged(),
|
||||
map((endpointURL: string) => new AuthGetRequest(this.requestService.generateRequestId(), endpointURL, options)),
|
||||
map ((request: GetRequest) => {
|
||||
request.responseMsToLive = 0;
|
||||
request.responseMsToLive = 10 * 1000;
|
||||
return request;
|
||||
}),
|
||||
tap((request: GetRequest) => this.requestService.configure(request)),
|
||||
|
@@ -205,7 +205,7 @@ export abstract class DataService<T extends CacheableObject> {
|
||||
first((href: string) => hasValue(href)))
|
||||
.subscribe((href: string) => {
|
||||
const request = new FindAllRequest(this.requestService.generateRequestId(), href, options);
|
||||
request.responseMsToLive = 0;
|
||||
request.responseMsToLive = 10 * 1000;
|
||||
this.requestService.configure(request);
|
||||
});
|
||||
|
||||
|
@@ -23,7 +23,7 @@ import { MappedCollectionsReponseParsingService } from './mapped-collections-rep
|
||||
/* tslint:disable:max-classes-per-file */
|
||||
|
||||
export abstract class RestRequest {
|
||||
public responseMsToLive = 0;
|
||||
public responseMsToLive = 10 * 1000;
|
||||
constructor(
|
||||
public uuid: string,
|
||||
public href: string,
|
||||
@@ -404,7 +404,7 @@ export class TaskDeleteRequest extends DeleteRequest {
|
||||
}
|
||||
|
||||
export class MyDSpaceRequest extends GetRequest {
|
||||
public responseMsToLive = 0;
|
||||
public responseMsToLive = 10 * 1000;
|
||||
}
|
||||
|
||||
export class RequestError extends Error {
|
||||
|
@@ -60,7 +60,7 @@ describe('SubmissionRestService test suite', () => {
|
||||
it('should configure a new SubmissionRequest', () => {
|
||||
const expected = new SubmissionRequest(requestService.generateRequestId(), resourceHref);
|
||||
// set cache time to zero
|
||||
expected.responseMsToLive = 0;
|
||||
expected.responseMsToLive = 10 * 1000;
|
||||
scheduler.schedule(() => service.getDataById(resourceEndpoint, resourceScope).subscribe());
|
||||
scheduler.flush();
|
||||
|
||||
|
@@ -110,7 +110,7 @@ export class SubmissionRestService {
|
||||
distinctUntilChanged(),
|
||||
map((endpointURL: string) => new SubmissionRequest(requestId, endpointURL)),
|
||||
map ((request: RestRequest) => {
|
||||
request.responseMsToLive = 0;
|
||||
request.responseMsToLive = 10 * 1000;
|
||||
return request;
|
||||
}),
|
||||
tap((request: RestRequest) => this.requestService.configure(request)),
|
||||
|
@@ -20,7 +20,7 @@ import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service';
|
||||
@Injectable()
|
||||
export class WorkflowItemDataService extends DataService<WorkflowItem> {
|
||||
protected linkPath = 'workflowitems';
|
||||
protected responseMsToLive = 0;
|
||||
protected responseMsToLive = 10 * 1000;
|
||||
|
||||
constructor(
|
||||
protected comparator: DSOChangeAnalyzer<WorkflowItem>,
|
||||
|
@@ -20,7 +20,7 @@ import { WorkspaceItem } from './models/workspaceitem.model';
|
||||
@Injectable()
|
||||
export class WorkspaceitemDataService extends DataService<WorkspaceItem> {
|
||||
protected linkPath = 'workspaceitems';
|
||||
protected responseMsToLive = 0;
|
||||
protected responseMsToLive = 10 * 1000;
|
||||
|
||||
constructor(
|
||||
protected comparator: DSOChangeAnalyzer<WorkspaceItem>,
|
||||
|
@@ -21,20 +21,7 @@ import { ProcessTaskResponse } from './models/process-task-response';
|
||||
*/
|
||||
@Injectable()
|
||||
export class ClaimedTaskDataService extends TasksService<ClaimedTask> {
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< 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.
|
||||
=======
|
||||
protected responseMsToLive = 0;
|
||||
>>>>>>> Renamed cache property and replaced conditional with hasValue.
|
||||
protected responseMsToLive = 10 * 1000;
|
||||
|
||||
/**
|
||||
* The endpoint link name
|
||||
|
@@ -26,25 +26,8 @@ export class PoolTaskDataService extends TasksService<PoolTask> {
|
||||
* The endpoint link name
|
||||
*/
|
||||
protected linkPath = 'pooltasks';
|
||||
protected responseMsToLive = 10 * 1000;
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
protected responseMsToLive = 0;
|
||||
|
||||
=======
|
||||
>>>>>>> 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.
|
||||
=======
|
||||
protected responseMsToLive = 0;
|
||||
>>>>>>> Renamed cache property and replaced conditional with hasValue.
|
||||
|
||||
>>>>>>> Setting cache period to zero for all instances where forceBypassCache was previously true.
|
||||
/**
|
||||
* Initialize instance variables
|
||||
*
|
||||
|
Reference in New Issue
Block a user