File tree 1 file changed +5
-2
lines changed
Filter options
src/Symfony/Component/Messenger/Middleware
1 file changed +5
-2
lines changed
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Messenger \Middleware ;
13
13
14
+ use Symfony \Component \Lock \Key ;
14
15
use Symfony \Component \Lock \LockFactory ;
15
16
use Symfony \Component \Messenger \Envelope ;
16
17
use Symfony \Component \Messenger \Message \LockableMessageInterface ;
@@ -39,9 +40,11 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope
39
40
if (null === $ envelope ->last (ReceivedStamp::class)) {
40
41
if ($ message instanceof LockableMessageInterface) {
41
42
// If we're trying to dispatch a lockable message.
42
- $ key = $ message ->getKey ();
43
+ $ keyResource = $ message ->getKey ();
44
+
45
+ if (null !== $ keyResource ) {
46
+ $ key = new Key ($ keyResource );
43
47
44
- if (null !== $ key ) {
45
48
// The acquire call must be done before stamping the message
46
49
// in order to have the full state of the key in the stamp.
47
50
$ lock = $ message instanceof TTLAwareLockableMessageInterface
You can’t perform that action at this time.
0 commit comments