Skip to content

Commit

Permalink
Merge pull request #2203 from acelaya-forks/feature/fix-memory-limit
Browse files Browse the repository at this point in the history
Fix `MEMORY_LIMIT` being ignored when provided as installer config option
  • Loading branch information
acelaya authored Oct 4, 2024
2 parents 9afc787 + 447ccca commit 9470279
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).

## [Unreleased]
## [4.2.1] - 2024-10-04
### Added
* [#2183](https://github.com/shlinkio/shlink/issues/2183) Redis database index to be used can now be specified in the connection URI path, and Shlink will honor it.

Expand All @@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
* *Nothing*

### Fixed
* *Nothing*
* [#2201](https://github.com/shlinkio/shlink/issues/2201) Fix `MEMORY_LIMIT` option being ignored when provided via installer options.


## [4.2.0] - 2024-08-11
Expand Down
6 changes: 4 additions & 2 deletions config/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

require 'vendor/autoload.php';

// Set a default memory limit, but allow custom values
ini_set('memory_limit', EnvVars::MEMORY_LIMIT->loadFromEnv('512M'));
// This is one of the first files loaded. Configure the timezone here
date_default_timezone_set(EnvVars::TIMEZONE->loadFromEnv(date_default_timezone_get()));

Expand All @@ -25,6 +23,10 @@ class_alias(Lock\LockFactory::class, LOCAL_LOCK_FACTORY);

return (static function (): ServiceManager {
$config = require __DIR__ . '/config.php';

// Set memory limit right after loading config, to ensure installer config has been promoted as env vars
ini_set('memory_limit', EnvVars::MEMORY_LIMIT->loadFromEnv('512M'));

$container = new ServiceManager($config['dependencies']);
$container->setService('config', $config);

Expand Down

0 comments on commit 9470279

Please sign in to comment.