Skip to content
Snippets Groups Projects
Commit 486d9daf authored by Torsten Kunst's avatar Torsten Kunst Committed by Torsten Kunst
Browse files

refs #49020 - add limit parameter to mails api call

parent 413b9c35
Branches
Tags
No related merge requests found
## v2.23.11
* #49020 - env variable ZMS_MAILS_PER_MINUTE verfügbar gemacht um Anzahl zu versendener Mails konfigurierbar zu machen
## v2.23.06
* #44026 Bugfix: Eine Mail ohne Inhalt wird aus der Datenbank entfernt und in die Log Tabelle wird ein entsprechender Eintrag geschrieben.
......
......
......@@ -48,4 +48,10 @@ class Application
* Logging PSR3 compatible
*/
public static $log = null;
/*
* -----------------------------------------------------------------------
* Mail settings
*/
public static $mails_per_minute = 300;
}
......@@ -18,7 +18,10 @@ class Mail extends BaseController
public function __construct($maxRunTime = 50)
{
parent::__construct($maxRunTime);
$queueList = \App::$http->readGetResult('/mails/')->getCollection();
$queueList = \App::$http->readGetResult('/mails/', [
'resolveReferences' => 2,
'limit' => \App::$mails_per_minute
])->getCollection();
if (null !== $queueList) {
$this->messagesQueue = $queueList->sortByCustomKey('createTimestamp');
}
......
......
......@@ -6,6 +6,7 @@ class DeleteFromQueueTest extends Base
{
protected function getApiCalls()
{
var_dump(\App::$mails_per_minute);
return [
[
'function' => 'setUserInfo',
......@@ -17,6 +18,10 @@ class DeleteFromQueueTest extends Base
[
'function' => 'readGetResult',
'url' => '/mails/',
'parameters' => [
'resolveReferences' => 2,
'limit' => 300
],
'response' => $this->readFixture("GET_mails_queue.json"),
],
[
......
......
......@@ -19,6 +19,10 @@ class DeleteMailsFailedTest extends Base
[
'function' => 'readGetResult',
'url' => '/mails/',
'parameters' => [
'resolveReferences' => 2,
'limit' => 300
],
'response' => $this->readFixture("GET_mails_queue.json"),
],
[
......
......
......@@ -24,6 +24,10 @@ class ExceptionsCatchTest extends Base
[
'function' => 'readGetResult',
'url' => '/mails/',
'parameters' => [
'resolveReferences' => 2,
'limit' => 300
],
'response' => $this->readFixture("GET_mails_queue_no_department.json"),
]
]
......@@ -86,6 +90,10 @@ class ExceptionsCatchTest extends Base
[
'function' => 'readGetResult',
'url' => '/mails/',
'parameters' => [
'resolveReferences' => 2,
'limit' => 300
],
'response' => $this->readFixture("GET_mails_queue_old.json")
],
[
......
......
......@@ -25,6 +25,10 @@ class SendMailTest extends Base
[
'function' => 'readGetResult',
'url' => '/mails/',
'parameters' => [
'resolveReferences' => 2,
'limit' => 300
],
'response' => $this->readFixture("GET_mails_queue.json"),
],
]
......@@ -56,6 +60,10 @@ class SendMailTest extends Base
[
'function' => 'readGetResult',
'url' => '/mails/',
'parameters' => [
'resolveReferences' => 2,
'limit' => 300
],
'response' => $this->readFixture("GET_queue_empty.json"),
],
]
......@@ -81,6 +89,10 @@ class SendMailTest extends Base
[
'function' => 'readGetResult',
'url' => '/mails/',
'parameters' => [
'resolveReferences' => 2,
'limit' => 300
],
'response' => $this->readFixture("GET_mails_queue_no_content.json")
],
[
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.