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
32129f51
Commit
32129f51
authored
Feb 20, 2020
by
Dominik Hebeler
Browse files
added liveness and readiness for fetcher
parent
eb379abf
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/RequestFetcher.php
View file @
32129f51
...
...
@@ -50,10 +50,17 @@ class RequestFetcher extends Command
*/
public
function
handle
()
{
$pidFile
=
"/tmp/fetcher"
;
pcntl_signal
(
SIGINT
,
[
$this
,
"sig_handler"
]);
pcntl_signal
(
SIGTERM
,
[
$this
,
"sig_handler"
]);
pcntl_signal
(
SIGHUP
,
[
$this
,
"sig_handler"
]);
touch
(
$pidFile
);
if
(
!
file_exists
(
$pidFile
))
{
return
;
}
try
{
$blocking
=
false
;
$redis
=
Redis
::
connection
(
"cache"
);
...
...
@@ -108,9 +115,8 @@ class RequestFetcher extends Command
usleep
(
50
*
1000
);
}
}
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
$e
->
getMessage
());
}
finally
{
unlink
(
$pidFile
);
curl_multi_close
(
$this
->
multicurl
);
}
}
...
...
chart/templates/deployment.yaml
View file @
32129f51
...
...
@@ -141,4 +141,18 @@ spec:
command
:
[
"
su"
]
args
:
[
"
-s"
,
"
/bin/sh"
,
"
-c"
,
"
php
artisan
requests:fetcher"
,
"
nginx"
]
imagePullPolicy
:
{{
.Values.image.pullPolicy
}}
livenessProbe
:
exec
:
command
:
-
cat
-
/tmp/fetcher
initialDelaySeconds
:
{{
.Values.livenessProbe.initialDelaySeconds
}}
timeoutSeconds
:
{{
.Values.livenessProbe.timeoutSeconds
}}
readinessProbe
:
exec
:
command
:
-
cat
-
/tmp/fetcher
initialDelaySeconds
:
{{
.Values.readinessProbe.initialDelaySeconds
}}
timeoutSeconds
:
{{
.Values.readinessProbe.timeoutSeconds
}}
{{
- end -
}}
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