The "cron_interval" is now reachable via the admin site settings

pull/13690/head
Michael 2023-12-03 11:20:37 +00:00
parent e87c79780a
commit 7bf7744efb
4 changed files with 244 additions and 231 deletions

View File

@ -142,6 +142,7 @@ class Site extends BaseAdmin
$worker_load_cooldown = (!empty($_POST['worker_load_cooldown']) ? intval($_POST['worker_load_cooldown']) : 0); $worker_load_cooldown = (!empty($_POST['worker_load_cooldown']) ? intval($_POST['worker_load_cooldown']) : 0);
$worker_fastlane = !empty($_POST['worker_fastlane']); $worker_fastlane = !empty($_POST['worker_fastlane']);
$decoupled_receiver = (!empty($_POST['decoupled_receiver']) ? intval(trim($_POST['decoupled_receiver'])) : false); $decoupled_receiver = (!empty($_POST['decoupled_receiver']) ? intval(trim($_POST['decoupled_receiver'])) : false);
$cron_interval = (!empty($_POST['cron_interval']) ? intval($_POST['cron_interval']) : 0);
$relay_directly = !empty($_POST['relay_directly']); $relay_directly = !empty($_POST['relay_directly']);
$relay_scope = (!empty($_POST['relay_scope']) ? trim($_POST['relay_scope']) : ''); $relay_scope = (!empty($_POST['relay_scope']) ? trim($_POST['relay_scope']) : '');
@ -305,6 +306,7 @@ class Site extends BaseAdmin
$transactionConfig->set('system', 'worker_load_cooldown', $worker_load_cooldown); $transactionConfig->set('system', 'worker_load_cooldown', $worker_load_cooldown);
$transactionConfig->set('system', 'worker_fastlane' , $worker_fastlane); $transactionConfig->set('system', 'worker_fastlane' , $worker_fastlane);
$transactionConfig->set('system', 'decoupled_receiver' , $decoupled_receiver); $transactionConfig->set('system', 'decoupled_receiver' , $decoupled_receiver);
$transactionConfig->set('system', 'cron_interval' , $cron_interval);
$transactionConfig->set('system', 'relay_directly' , $relay_directly); $transactionConfig->set('system', 'relay_directly' , $relay_directly);
$transactionConfig->set('system', 'relay_scope' , $relay_scope); $transactionConfig->set('system', 'relay_scope' , $relay_scope);
@ -547,7 +549,8 @@ class Site extends BaseAdmin
'$worker_load_cooldown' => ['worker_load_cooldown', DI::l10n()->t('Maximum load for workers'), DI::config()->get('system', 'worker_load_cooldown'), DI::l10n()->t('Maximum load that causes a cooldown before each worker function call.')], '$worker_load_cooldown' => ['worker_load_cooldown', DI::l10n()->t('Maximum load for workers'), DI::config()->get('system', 'worker_load_cooldown'), DI::l10n()->t('Maximum load that causes a cooldown before each worker function call.')],
'$worker_fastlane' => ['worker_fastlane', DI::l10n()->t('Enable fastlane'), DI::config()->get('system', 'worker_fastlane'), DI::l10n()->t('When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.')], '$worker_fastlane' => ['worker_fastlane', DI::l10n()->t('Enable fastlane'), DI::config()->get('system', 'worker_fastlane'), DI::l10n()->t('When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.')],
'$decoupled_receiver' => ['decoupled_receiver', DI::l10n()->t('Decoupled receiver'), DI::config()->get('system', 'decoupled_receiver'), DI::l10n()->t('Decouple incoming ActivityPub posts by processing them in the background via a worker process. Only enable this on fast systems.')], '$decoupled_receiver' => ['decoupled_receiver', DI::l10n()->t('Decoupled receiver'), DI::config()->get('system', 'decoupled_receiver'), DI::l10n()->t('Decouple incoming ActivityPub posts by processing them in the background via a worker process. Only enable this on fast systems.')],
'$cron_interval' => ['cron_interval', DI::l10n()->t('Cron interval'), DI::config()->get('system', 'decoupled_receiver'), DI::l10n()->t('Minimal period in minutes between two calls of the "Cron" worker job.')],
'$relay_directly' => ['relay_directly', DI::l10n()->t('Direct relay transfer'), DI::config()->get('system', 'relay_directly'), DI::l10n()->t('Enables the direct transfer to other servers without using the relay servers')], '$relay_directly' => ['relay_directly', DI::l10n()->t('Direct relay transfer'), DI::config()->get('system', 'relay_directly'), DI::l10n()->t('Enables the direct transfer to other servers without using the relay servers')],
'$relay_scope' => ['relay_scope', DI::l10n()->t('Relay scope'), DI::config()->get('system', 'relay_scope'), DI::l10n()->t('Can be "all" or "tags". "all" means that every public post should be received. "tags" means that only posts with selected tags should be received.'), [Relay::SCOPE_NONE => DI::l10n()->t('Disabled'), Relay::SCOPE_ALL => DI::l10n()->t('all'), Relay::SCOPE_TAGS => DI::l10n()->t('tags')]], '$relay_scope' => ['relay_scope', DI::l10n()->t('Relay scope'), DI::config()->get('system', 'relay_scope'), DI::l10n()->t('Can be "all" or "tags". "all" means that every public post should be received. "tags" means that only posts with selected tags should be received.'), [Relay::SCOPE_NONE => DI::l10n()->t('Disabled'), Relay::SCOPE_ALL => DI::l10n()->t('all'), Relay::SCOPE_TAGS => DI::l10n()->t('tags')]],
'$relay_server_tags' => ['relay_server_tags', DI::l10n()->t('Server tags'), DI::config()->get('system', 'relay_server_tags'), DI::l10n()->t('Comma separated list of tags for the "tags" subscription.')], '$relay_server_tags' => ['relay_server_tags', DI::l10n()->t('Server tags'), DI::config()->get('system', 'relay_server_tags'), DI::l10n()->t('Comma separated list of tags for the "tags" subscription.')],

File diff suppressed because it is too large Load Diff

View File

@ -122,6 +122,7 @@
{{include file="field_checkbox.tpl" field=$optimize_tables}} {{include file="field_checkbox.tpl" field=$optimize_tables}}
{{include file="field_checkbox.tpl" field=$cache_contact_avatar}} {{include file="field_checkbox.tpl" field=$cache_contact_avatar}}
{{include file="field_input.tpl" field=$min_poll_interval}} {{include file="field_input.tpl" field=$min_poll_interval}}
{{include file="field_input.tpl" field=$cron_interval}}
<div class="submit"><input type="submit" name="page_site" value="{{$submit}}"/></div> <div class="submit"><input type="submit" name="page_site" value="{{$submit}}"/></div>
<h2>{{$worker_title}}</h2> <h2>{{$worker_title}}</h2>

View File

@ -256,6 +256,7 @@
{{include file="field_checkbox.tpl" field=$optimize_tables}} {{include file="field_checkbox.tpl" field=$optimize_tables}}
{{include file="field_checkbox.tpl" field=$cache_contact_avatar}} {{include file="field_checkbox.tpl" field=$cache_contact_avatar}}
{{include file="field_input.tpl" field=$min_poll_interval}} {{include file="field_input.tpl" field=$min_poll_interval}}
{{include file="field_input.tpl" field=$cron_interval}}
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
<input type="submit" name="page_site" class="btn btn-primary" value="{{$submit}}"/> <input type="submit" name="page_site" class="btn btn-primary" value="{{$submit}}"/>