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
cf57f71d
Commit
cf57f71d
authored
Aug 28, 2020
by
Dominik Hebeler
Browse files
added humanverification error log
parent
138438ae
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Middleware/HumanVerification.php
View file @
cf57f71d
...
...
@@ -128,10 +128,11 @@ class HumanVerification
if
(
$user
[
"unusedResultPages"
]
===
50
||
(
$user
[
"unusedResultPages"
]
>
50
&&
$user
[
"unusedResultPages"
]
%
25
===
0
))
{
$user
[
"locked"
]
=
true
;
}
}
\
App\PrometheusExporter
::
HumanVerificationSuccessfull
();
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
$e
->
getMessage
());
\
App\PrometheusExporter
::
HumanVerificationError
();
}
finally
{
if
(
$update
&&
$user
!=
null
)
{
if
(
$user
[
"whitelist"
])
{
...
...
@@ -141,7 +142,6 @@ class HumanVerification
}
try
{
$this
->
setUser
(
$prefix
,
$user
);
\
App\PrometheusExporter
::
HumanVerificationSuccessfull
();
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
$e
->
getMessage
());
}
...
...
app/PrometheusExporter.php
View file @
cf57f71d
...
...
@@ -29,7 +29,14 @@ class PrometheusExporter
public
static
function
HumanVerificationSuccessfull
()
{
$registry
=
\
Prometheus\CollectorRegistry
::
getDefault
();
$counter
=
$registry
->
getOrRegisterCounter
(
'metager'
,
'humanverification'
,
'counts how often humanverification middleware was successfull'
,
[]);
$counter
=
$registry
->
getOrRegisterCounter
(
'metager'
,
'humanverification_success'
,
'counts how often humanverification middleware was successfull'
,
[]);
$counter
->
inc
();
}
public
static
function
HumanVerificationError
()
{
$registry
=
\
Prometheus\CollectorRegistry
::
getDefault
();
$counter
=
$registry
->
getOrRegisterCounter
(
'metager'
,
'humanverification_error'
,
'counts how often humanverification middleware had an error'
,
[]);
$counter
->
inc
();
}
}
Write
Preview
Markdown
is supported
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