Skip to content

Commit f3d4dcb

Browse files
committed
fix serialization of rate limited middleware
1 parent 19f338e commit f3d4dcb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/Illuminate/Queue/Middleware/RateLimited.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,31 @@ protected function getTimeUntilNextRetry($key)
120120
{
121121
return $this->limiter->availableIn($key) + 3;
122122
}
123+
124+
/**
125+
* Prepare the object for serialization.
126+
*
127+
* @return array
128+
*/
129+
public function __serialize()
130+
{
131+
return [
132+
'limiterName' => $this->limiterName,
133+
'shouldRelease' => $this->shouldRelease,
134+
];
135+
}
136+
137+
/**
138+
* Prepare the object after unserialization.
139+
*
140+
* @param array $data
141+
* @return void
142+
*/
143+
public function __unserialize(array $data)
144+
{
145+
$this->limiter = Container::getInstance()->make(RateLimiter::class);
146+
147+
$this->limitedName = $data['limiterName'];
148+
$this->shouldRelease = $data['shouldRelease'];
149+
}
123150
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy