crunz
crunz copied to clipboard
[Deprecation] Since symfony/lock 5.2: Symfony\Component\Lock\Store\RetryTillSaveStore is deprecated
Crunz version: 2.3.1
PHP version: 7.3
Operating system type and version: ubuntu 20.04
Description
[Deprecation] Since symfony/lock 5.2: Symfony\Component\Lock\Store\RetryTillSaveStore is deprecated
How to reproduce
use Symfony\Component\Lock\Store\RedisStore;
use Symfony\Component\Lock\Store\RetryTillSaveStore;
$redis = new Redis(); $redis->connect('localhost'); $persistingStore = new RedisStore($redis); $blockingStore = new RetryTillSaveStore($persistingStore);
$task = $schedule->run(PHP_BINARY . ' email.php'); $task ->everyFiveMinutes() ->preventOverlapping($blockingStore);
Possible Solution
Additional context
As you can see deprecation is in your code, there is nothing wrong in Crunz.
@PabloKowalczyk This code it's your code on your readme =>
As of Symfony 5.0 the StoreInterface has been split into BlockingStoreInterface and PersistingStoreInterface. To use any of the persistent locks (Redis, PDO, etc) they need to be decorated by the RetryTillSaveStore.
<?php
use Symfony\Component\Lock\Store\RedisStore;
use Symfony\Component\Lock\Store\RetryTillSaveStore;
$redis = new Redis();
$redis->connect('localhost');
$persistingStore = new RedisStore($redis);
$blockingStore = new RetryTillSaveStore($persistingStore);
$task = $schedule->run(PHP_BINARY . ' email.php');
$task
->everyFiveMinutes()
->preventOverlapping($blockingStore);
You are right, would you like to provide a PR?