Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
ff3409ed
Commit
ff3409ed
authored
Dec 09, 2019
by
Dominik Hebeler
Browse files
5 processes handling cache writes now
parent
e3a3ca0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/RequestFetcher.php
View file @
ff3409ed
...
...
@@ -50,7 +50,15 @@ class RequestFetcher extends Command
*/
public
function
handle
()
{
$pid
=
\
pcntl_fork
();
$pids
=
[];
$pid
=
null
;
for
(
$i
=
0
;
$i
<
5
;
$i
++
)
{
$pid
=
\
pcntl_fork
();
$pids
[]
=
$pid
;
if
(
$pid
===
0
)
{
break
;
}
}
if
(
$pid
===
0
)
{
Artisan
::
call
(
'requests:cacher'
);
exit
;
...
...
@@ -124,8 +132,9 @@ class RequestFetcher extends Command
}
finally
{
curl_multi_close
(
$this
->
multicurl
);
}
\
pcntl_waitpid
(
$pid
,
$status
,
WNOHANG
);
foreach
(
$pids
as
$tmppid
)
{
\
pcntl_waitpid
(
$tmppid
,
$status
,
WNOHANG
);
}
}
private
function
getCurlHandle
(
$job
)
...
...
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