Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
55fc047a
Commit
55fc047a
authored
Aug 28, 2020
by
Dominik Hebeler
Browse files
Catching connection error to redis cache in middleware
parent
58f85ea1
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Middleware/HumanVerification.php
View file @
55fc047a
...
...
@@ -7,6 +7,7 @@ use Captcha;
use
Closure
;
use
Cookie
;
use
Illuminate\Http\Response
;
use
Log
;
use
URL
;
class
HumanVerification
...
...
@@ -66,7 +67,6 @@ class HumanVerification
}
else
{
$user
=
$users
[
$uid
];
}
# Lock out everyone in a Bot network
# Find out how many requests this IP has made
$sum
=
0
;
...
...
@@ -130,8 +130,10 @@ class HumanVerification
}
}
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
$e
->
getMessage
());
}
finally
{
if
(
$update
)
{
if
(
$update
&&
$user
!=
null
)
{
if
(
$user
[
"whitelist"
])
{
$user
[
"expiration"
]
=
now
()
->
addWeeks
(
2
);
}
else
{
...
...
@@ -148,7 +150,6 @@ class HumanVerification
public
function
setUser
(
$prefix
,
$user
)
{
// Lock must be acquired within 2 seconds
$userList
=
Cache
::
get
(
$prefix
.
"."
.
$user
[
"id"
],
[]);
$userList
[
$user
[
"uid"
]]
=
$user
;
Cache
::
put
(
$prefix
.
"."
.
$user
[
"id"
],
$userList
,
2
*
7
*
24
*
60
*
60
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment