Skip to content
GitLab
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
dbf4da26
Commit
dbf4da26
authored
Aug 24, 2021
by
Dominik Hebeler
Browse files
waiting for redis connection when loading spam entries
parent
893325a0
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/LoadSpam.php
View file @
dbf4da26
...
...
@@ -39,6 +39,19 @@ class LoadSpam extends Command
*/
public
function
handle
()
{
// Redis might not be available now
for
(
$count
=
0
;
$count
<
10
;
$count
++
)
{
try
{
Redis
::
connection
();
break
;
}
catch
(
\
Predis\Connection\ConnectionException
$e
)
{
if
(
$count
>=
9
)
{
// If its not available after 10 seconds we will exit
return
;
}
sleep
(
1
);
}
}
$filePath
=
\
storage_path
(
'logs/metager/ban.txt'
);
$bans
=
[];
if
(
\
file_exists
(
$filePath
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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