mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-27 20:11:34 +03:00
Updated GeolocationDbUpdater to always use a local lock even if redis config is provided
This commit is contained in:
parent
7c1e40be88
commit
d030fd1aa6
3 changed files with 11 additions and 2 deletions
|
@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
||||||
* [#512](https://github.com/shlinkio/shlink/issues/512) Fixed query params not being properly forwarded from short URL to long one.
|
* [#512](https://github.com/shlinkio/shlink/issues/512) Fixed query params not being properly forwarded from short URL to long one.
|
||||||
* [#540](https://github.com/shlinkio/shlink/issues/540) Fixed errors thrown when creating short URLs if the original URL has an internationalized domain name and URL validation is enabled.
|
* [#540](https://github.com/shlinkio/shlink/issues/540) Fixed errors thrown when creating short URLs if the original URL has an internationalized domain name and URL validation is enabled.
|
||||||
* [#528](https://github.com/shlinkio/shlink/issues/528) Ensured `db:create` and `db:migrate` commands do not silently fail when run as part of `install` or `update`.
|
* [#528](https://github.com/shlinkio/shlink/issues/528) Ensured `db:create` and `db:migrate` commands do not silently fail when run as part of `install` or `update`.
|
||||||
|
* [#518](https://github.com/shlinkio/shlink/issues/518) Fixed service which updates Geolite db file to use a local lock instead of a shared one, since every shlink instance holds its own db instance.
|
||||||
|
|
||||||
|
|
||||||
## 1.20.0 - 2019-11-02
|
## 1.20.0 - 2019-11-02
|
||||||
|
|
|
@ -8,6 +8,10 @@ use Shlinkio\Shlink\Common\Logger\LoggerAwareDelegatorFactory;
|
||||||
use Symfony\Component\Lock;
|
use Symfony\Component\Lock;
|
||||||
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
||||||
|
|
||||||
|
// This class alias tricks the ConfigAbstractFactory to return Lock\Factory instances even with a different service name
|
||||||
|
$localLockFactory = 'Shlinkio\Shlink\LocalLockFactory';
|
||||||
|
class_alias(Lock\Factory::class, $localLockFactory);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'locks' => [
|
'locks' => [
|
||||||
|
@ -19,11 +23,14 @@ return [
|
||||||
Lock\Store\FlockStore::class => ConfigAbstractFactory::class,
|
Lock\Store\FlockStore::class => ConfigAbstractFactory::class,
|
||||||
Lock\Store\RedisStore::class => ConfigAbstractFactory::class,
|
Lock\Store\RedisStore::class => ConfigAbstractFactory::class,
|
||||||
Lock\Factory::class => ConfigAbstractFactory::class,
|
Lock\Factory::class => ConfigAbstractFactory::class,
|
||||||
|
$localLockFactory => ConfigAbstractFactory::class,
|
||||||
],
|
],
|
||||||
'aliases' => [
|
'aliases' => [
|
||||||
// With this config, a user could alias 'lock_store' => 'redis_lock_store' to override the default
|
// With this config, a user could alias 'lock_store' => 'redis_lock_store' to override the default
|
||||||
'lock_store' => Lock\Store\FlockStore::class,
|
'lock_store' => 'local_lock_store',
|
||||||
|
|
||||||
'redis_lock_store' => Lock\Store\RedisStore::class,
|
'redis_lock_store' => Lock\Store\RedisStore::class,
|
||||||
|
'local_lock_store' => Lock\Store\FlockStore::class,
|
||||||
],
|
],
|
||||||
'delegators' => [
|
'delegators' => [
|
||||||
Lock\Store\RedisStore::class => [
|
Lock\Store\RedisStore::class => [
|
||||||
|
@ -39,6 +46,7 @@ return [
|
||||||
Lock\Store\FlockStore::class => ['config.locks.locks_dir'],
|
Lock\Store\FlockStore::class => ['config.locks.locks_dir'],
|
||||||
Lock\Store\RedisStore::class => [RedisFactory::SERVICE_NAME],
|
Lock\Store\RedisStore::class => [RedisFactory::SERVICE_NAME],
|
||||||
Lock\Factory::class => ['lock_store'],
|
Lock\Factory::class => ['lock_store'],
|
||||||
|
$localLockFactory => ['local_lock_store'],
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -58,7 +58,7 @@ return [
|
||||||
],
|
],
|
||||||
|
|
||||||
ConfigAbstractFactory::class => [
|
ConfigAbstractFactory::class => [
|
||||||
GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, Locker::class],
|
GeolocationDbUpdater::class => [DbUpdater::class, Reader::class, 'Shlinkio\Shlink\LocalLockFactory'],
|
||||||
|
|
||||||
Command\ShortUrl\GenerateShortUrlCommand::class => [Service\UrlShortener::class, 'config.url_shortener.domain'],
|
Command\ShortUrl\GenerateShortUrlCommand::class => [Service\UrlShortener::class, 'config.url_shortener.domain'],
|
||||||
Command\ShortUrl\ResolveUrlCommand::class => [Service\UrlShortener::class],
|
Command\ShortUrl\ResolveUrlCommand::class => [Service\UrlShortener::class],
|
||||||
|
|
Loading…
Add table
Reference in a new issue