зеркало из https://github.com/mozilla/fxa.git
feat(redis): start redis on server start mozilla/fxa-local-dev#91)
This commit is contained in:
Родитель
2e9956352f
Коммит
a620d8d83d
|
@ -0,0 +1,3 @@
|
|||
const RedisServer = require('redis-server');
|
||||
const server = new RedisServer(process.env.port);
|
||||
server.open().then(() => {});
|
|
@ -1,2 +0,0 @@
|
|||
redis-cli shutdown
|
||||
redis-server
|
|
@ -32,6 +32,7 @@
|
|||
"lodash": "4.16.2",
|
||||
"minimist": "1.1.1",
|
||||
"pm2": "2.2.3",
|
||||
"replace-in-file": "0.2.1"
|
||||
"replace-in-file": "0.2.1",
|
||||
"redis-server": "1.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
{
|
||||
"apps": [
|
||||
{
|
||||
"name": "redis PORT 6379",
|
||||
"script": "_scripts/redis.js",
|
||||
"env": {
|
||||
"PORT": "6379"
|
||||
},
|
||||
"max_restarts": "1",
|
||||
"min_uptime": "2m"
|
||||
},
|
||||
{
|
||||
"name": "auth-server local mail helper",
|
||||
"script": "test/mail_helper.js",
|
||||
|
|
18
test/curl.sh
18
test/curl.sh
|
@ -21,6 +21,21 @@ function check() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
function check_redis() {
|
||||
RETRY=12
|
||||
for i in $(eval echo "{1..$RETRY}"); do
|
||||
if echo PING | nc localhost 6379 | grep -q 'PONG'; then
|
||||
return
|
||||
else
|
||||
if [ $i -lt $RETRY ]; then
|
||||
sleep 10
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
# content
|
||||
check 127.0.0.1:3030
|
||||
check 127.0.0.1:1114
|
||||
|
@ -47,3 +62,6 @@ check 127.0.0.1:5050 405
|
|||
# sync server
|
||||
# address of the endpoint have to be the same as a public_url in settings
|
||||
check localhost:5000
|
||||
|
||||
# redis server
|
||||
check_redis
|
||||
|
|
Загрузка…
Ссылка в новой задаче