The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit a880c167 authored by Demian Katz's avatar Demian Katz
Browse files

More failure percentage configuration.

parent dd2ef04c
No related merge requests found
......@@ -50,8 +50,11 @@ cancelHolds = 50
cancelILLRequests = 50
cancelStorageRetrievalRequests = 50
changePassword = 33
checkILLRequestBlock = 10
checkILLRequestIsValid = 10
checkRequestBlock = 10
checkRequestIsValid = 10
checkStorageRetrievalRequestBlock = 10
checkStorageRetrievalRequestIsValid = 10
getDefaultRequestGroup = 50
getHoldDefaultRequiredDate = 50
......
......@@ -252,6 +252,36 @@ class Demo extends AbstractBase
? $this->config['Records']['source'] : DEFAULT_SEARCH_BACKEND;
}
/**
* Are holds/recalls blocked?
*
* @return bool
*/
protected function checkRequestBlock()
{
return $this->isFailing(__METHOD__, 10);
}
/**
* Are ILL requests blocked?
*
* @return bool
*/
protected function checkILLRequestBlock()
{
return $this->isFailing(__METHOD__, 10);
}
/**
* Are storage retrieval requests blocked?
*
* @return bool
*/
protected function checkStorageRetrievalRequestBlock()
{
return $this->isFailing(__METHOD__, 10);
}
/**
* Generates a random, fake holding array
*
......@@ -280,16 +310,16 @@ class Demo extends AbstractBase
'callnumber' => $this->getFakeCallNum(),
'duedate' => '',
'is_holdable' => true,
'addLink' => $patron ? rand() % 10 == 0 ? 'block' : true : false,
'addLink' => $patron
? $this->checkRequestBlock() ? 'block' : true : false,
'level' => 'copy',
'storageRetrievalRequest' => 'auto',
'addStorageRetrievalRequestLink' => $patron
? rand() % 10 == 0 ? 'block' : 'check'
? $this->checkStorageRetrievalRequestBlock() ? 'block' : 'check'
: false,
'ILLRequest' => 'auto',
'addILLRequestLink' => $patron
? rand() % 10 == 0 ? 'block' : 'check'
: false
? $this->checkILLRequestBlock() ? 'block' : 'check' : false
];
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment