mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-23 02:58:54 +00:00
[Web] Add Mailcow\ class structure and imapsync module classes
This commit is contained in:
26 files changed
+2821
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mailcow\Imapsync\Model;
|
||||
|
||||
/**
|
||||
* Global sync job settings (table `imapsync_settings`), read by the runner.
|
||||
*/
|
||||
class Settings
|
||||
{
|
||||
public int $maxParallel = 1;
|
||||
/** Global bandwidth limit in bytes/s, 0 = unlimited */
|
||||
public int $maxBytesPerSecond = 0;
|
||||
|
||||
/**
|
||||
* API representation (GET imapsync_settings); the UI edits the limit in KB/s.
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'max_parallel' => $this->maxParallel,
|
||||
'max_bytes_per_second' => $this->maxBytesPerSecond,
|
||||
'max_kb_per_second' => intdiv($this->maxBytesPerSecond, 1024),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user