feat: delay init table
This commit is contained in:
parent
2249552957
commit
0b45fa37da
11
README.md
Normal file
11
README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# `cc-server-parent`
|
||||
|
||||
> TODO: description
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
const ccServerDbMongo = require('cc-server-parent');
|
||||
|
||||
// TODO: DEMONSTRATE API
|
||||
```
|
39
cli.sh
Normal file
39
cli.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# User Input Variable
|
||||
action=up
|
||||
name=
|
||||
type=micro
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-a)
|
||||
action="$2"
|
||||
shift
|
||||
;;
|
||||
-n|-p)
|
||||
name="$2"
|
||||
shift
|
||||
;;
|
||||
-t)
|
||||
type="$2"
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
echo "Illegal option $1"
|
||||
;;
|
||||
esac
|
||||
shift $(( $# > 0 ? 1 : 0 ))
|
||||
done
|
||||
|
||||
case "${action}" in
|
||||
up)
|
||||
faas-cli build -f ${name}.yml
|
||||
faas-cli deploy -f ${name}.yml --label "com.openfaas.scale.zero=true"
|
||||
;;
|
||||
create)
|
||||
faas-cli new ${name} --lang cc-server
|
||||
;;
|
||||
esac
|
||||
|
@ -5,6 +5,10 @@
|
||||
"main": "index.js",
|
||||
"author": "MiaoWoo <admin@yumc.pw>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"prepublish": "npx lerna run build",
|
||||
"lp": "npx lerna publish"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
|
@ -27,7 +27,9 @@ export class Controller {
|
||||
|
||||
@postConstruct()
|
||||
private init(): void {
|
||||
this.client.setTable(TABLE);
|
||||
setTimeout(() => {
|
||||
this.client.setTable(TABLE);
|
||||
}, 50)
|
||||
}
|
||||
|
||||
@httpGet('/')
|
||||
|
Loading…
Reference in New Issue
Block a user