File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/Illuminate/Queue/Middleware Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -120,4 +120,31 @@ protected function getTimeUntilNextRetry($key)
120
120
{
121
121
return $ this ->limiter ->availableIn ($ key ) + 3 ;
122
122
}
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
+ }
123
150
}
You can’t perform that action at this time.
0 commit comments