Skip to content

Commit

Permalink
Move system settings configuration to Beam module
Browse files Browse the repository at this point in the history
The settings were not propagated to the Skeleton and
were ignored by the Skeleton apps. This could cause
schedule commands not being execute due to "notOverlapping"
flags, which were written to the Redis correctly.

remp/remp#1292
  • Loading branch information
rootpd committed Aug 11, 2023
1 parent b0c9fd4 commit 3ce2eee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions config/system.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

$definition = env('COMMANDS_MEMORY_LIMITS');
$limits = [];

if (!empty($definition)) {
foreach (explode(',', $definition) as $commandLimit) {
$config = explode('::', $commandLimit);
if (count($config) !== 2 || empty($config[0]) || empty($config[1])) {
throw new \Exception('invalid format of COMMANDS_MEMORY_LIMITS entry; expected "command::limit", got "' . $commandLimit . '"');
}
$limits[$config[0]] = $config[1];
}
}

return [
'commands_memory_limits' => $limits,
'commands_overlapping_expires_at' => env('COMMANDS_OVERLAPPING_EXPIRES_AT', 15),
'commands' => [
'aggregate_article_views' => [
'default_step' => env('AGGREGATE_ARTICLE_VIEWS_DEFAULT_STEP'),
],
],
];
1 change: 1 addition & 0 deletions src/BeamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function boot()
__DIR__ . '/../public/' => public_path('vendor/beam'),
__DIR__ .'/../config/beam.php' => config_path('beam.php'),
__DIR__ .'/../config/services.php' => config_path('services.remp.php'),
__DIR__ .'/../config/system.php' => config_path('system.php'),
], ['beam-assets', 'laravel-assets']
);

Expand Down

0 comments on commit 3ce2eee

Please sign in to comment.