From: Vincent Vanwaelscappel Date: Wed, 18 Jan 2023 05:45:12 +0000 (+0100) Subject: wait #5686 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a17cecebfe66dd697f8ef239d3cb9e31d5b0205f;p=fluidbook-toolbox.git wait #5686 @1 --- diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 3517b01cc..d29a03397 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -24,14 +24,18 @@ class Kernel extends \Cubist\Backpack\Console\Kernel */ protected function schedule(Schedule $schedule) { - parent::schedule($schedule); + $schedule->command('queue:prune-failed --hours=24')->daily()->at('03:50'); + $schedule->command('job:dispatch Maintenance\\\\CleanDownloads')->dailyAt('4:00'); + // $schedule->command('backup:clean')->daily()->at('04:00'); + // $schedule->command('backup:run')->daily()->at('05:00'); + + $schedule->command('ws:migrate --publications=v2 --documents=missing')->dailyAt('1:00'); - $schedule->command('cubist:magic:precache')->everyFiveMinutes(); $schedule->command('job:dispatch ProcessTotals')->everyTwoHours(); - $schedule->command('job:dispatch Maintenance\\CleanDownloads')->dailyAt('4:00'); - $schedule->command('fluidbook:farm:ping')->everyMinute(); $schedule->command('fluidbook:player:updatesources')->everyTwoHours(); - $schedule->command('ws:migrate --publications=v2 --documents=missing')->dailyAt('1:00'); + + $schedule->command('fluidbook:farm:ping')->everyMinute(); + $schedule->command('cubist:magic:precache')->everyFiveMinutes(); } /** diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index 7a84a9a95..2f72467c4 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -6,7 +6,6 @@ use Cubist\Util\Files\Files; use hollodotme\FastCGI\Client; use hollodotme\FastCGI\Requests\PostRequest; use hollodotme\FastCGI\SocketConnections\NetworkSocket; -use function App\Util\is_countable; class Farm { @@ -100,7 +99,7 @@ class Farm error_log($log); - return str_replace('/fluidbook/docs/','/protected/fluidbookpublication/docs/',$res); + return str_replace('/fluidbook/docs/', '/protected/fluidbookpublication/docs/', $res); } public static function ping($echo = true, $force = false) @@ -146,3 +145,5 @@ class Farm file_put_contents(self::_serversCache(), json_encode($servers)); } } + + diff --git a/app/Slack/Slack.php b/app/Slack/Slack.php index 8d7c95e58..574efd7da 100644 --- a/app/Slack/Slack.php +++ b/app/Slack/Slack.php @@ -57,6 +57,9 @@ class Slack $actionsText = ''; $i = 0; foreach ($actions as $label => $data) { + if (is_null($data)) { + $data = ['url' => '#nourl']; + } if (is_string($data)) { $data = ['url' => $data]; } @@ -106,6 +109,7 @@ class Slack return $response->getTs(); } } catch (\Exception $e) { + Log::critical($e); Log::critical($e->getMessage() . ' // ' . $from . ' // ' . $channel . ' // ' . $text . ' // ' . $blocks); } return false; diff --git a/scripts/restartworkers.bat b/scripts/restartworkers.bat index 9f7710080..454106dc7 100644 --- a/scripts/restartworkers.bat +++ b/scripts/restartworkers.bat @@ -3,3 +3,5 @@ cls C:\tools\cygwin\bin\ssh.exe -t root@toolbox.fluidbook.com 'docker exec -it -u toolbox fluidbook-toolbox /application/scripts/restartworkers' exit exit +exit +