add cron recipe to lando configs

This commit is contained in:
Mike Macgirvin 2022-11-05 07:37:46 +11:00
parent ebdfd2abde
commit 3233c6fcb3
6 changed files with 26 additions and 9 deletions

View file

@ -22,6 +22,14 @@ services:
XDEBUG_SESSION_START: lando
config:
php: .vscode/php.ini
build_as_root:
- apt-get update -y
- apt-get install cron -y
- cp -f /app/.lando/cron-helper.sh /usr/local/bin/docker-php-entrypoint
run_as_root:
- service cron start
run:
- crontab /app/.lando/cron.txt
proxy:
mailservice:
- mail.lndo.site

11
.lando/cron-helper.sh Normal file
View file

@ -0,0 +1,11 @@
#!/bin/sh
service cron start
set -e
# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
fi
exec "$@"

1
.lando/cron.txt Normal file
View file

@ -0,0 +1 @@
*/10 * * * * cd /app; /usr/local/bin/php Code/Daemon/Run.php Cron > /dev/null 2>&1

View file

@ -243,9 +243,9 @@ class Channel
/**
* @brief Return the total number of channels on this site.
*
* No filtering is performed except to check PAGE_REMOVED.
* No filtering is performed except to check channel_removed.
*
* @returns int|booleean
* @returns int|bool
* on error returns boolean false
*/
public static function channel_total()

View file

@ -296,7 +296,7 @@ class Libzot
* @param array $channel => local channel structure of target recipient, required for "friending" operations
* @param array $force (optional) default false
*
* @return boolean
* @return bool
* * \b true if successful
* * otherwise \b false
*/

View file

@ -30,15 +30,12 @@ class Channel
public function post()
{
$channel = App::get_channel();
check_form_security_token_redirectOnErr('/settings', 'settings');
Hook::call('settings_post', $_POST);
$set_perms = '';
$role = ((x($_POST, 'permissions_role')) ? notags(trim($_POST['permissions_role'])) : '');
$oldrole = get_pconfig(local_channel(), 'system', 'permissions_role');
@ -47,7 +44,7 @@ class Channel
$role = $oldrole;
}
if (($role != $oldrole) || ($role === 'custom')) {
if (($role !== $oldrole) || ($role === 'custom')) {
$this->change_permissions_role($channel, $role);
}
@ -177,9 +174,9 @@ class Channel
set_pconfig(local_channel(), 'system', 'noindex', $noindex);
set_pconfig(local_channel(), 'system', 'preview_outbox', $preview_outbox);
$r = q(
"update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d",
"update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s',
channel_notifyflags = %d, channel_max_friend_req = %d, channel_expire_days = %d where channel_id = %d",
dbesc($username),
intval($pageflags),
dbesc($timezone),