Fix issue with upgrading to postgres 12 docker image #36
This commit is contained in:
parent
be5d4e976a
commit
7acf28bb3c
4
Makefile
4
Makefile
|
@ -35,7 +35,7 @@ $(GORICE):
|
||||||
|
|
||||||
$(WEB_BUILD_DIR):
|
$(WEB_BUILD_DIR):
|
||||||
@echo "First install Yarn and create a build of the web UI found under ./web"
|
@echo "First install Yarn and create a build of the web UI found under ./web"
|
||||||
@echo "Command: cd web && yarn build"
|
@echo "Command: cd web && yarn && yarn build"
|
||||||
@exit 1
|
@exit 1
|
||||||
|
|
||||||
$(GITCHGLOG):
|
$(GITCHGLOG):
|
||||||
|
@ -77,7 +77,7 @@ clean:
|
||||||
run: clean
|
run: clean
|
||||||
@go run $(BUILD_FLAGS) main.go $(ARGS)
|
@go run $(BUILD_FLAGS) main.go $(ARGS)
|
||||||
|
|
||||||
install:
|
install: gen
|
||||||
@echo $(GOPATH)
|
@echo $(GOPATH)
|
||||||
@echo "Commit Hash: `git rev-parse HEAD`"
|
@echo "Commit Hash: `git rev-parse HEAD`"
|
||||||
@echo "Old Hash: `shasum $(GOPATH)/bin/$(BINARY) 2>/dev/null | cut -c -32`"
|
@echo "Old Hash: `shasum $(GOPATH)/bin/$(BINARY) 2>/dev/null | cut -c -32`"
|
||||||
|
|
|
@ -2,11 +2,11 @@ version: '3.4'
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:12
|
image: postgres:12
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
|
||||||
# redis:
|
# redis:
|
||||||
# image: redis:alpine
|
# image: redis:alpine
|
||||||
|
|
13
serv/init.go
13
serv/init.go
|
@ -5,6 +5,7 @@ import (
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/dosco/super-graph/allow"
|
"github.com/dosco/super-graph/allow"
|
||||||
"github.com/dosco/super-graph/crypto"
|
"github.com/dosco/super-graph/crypto"
|
||||||
|
@ -135,7 +136,17 @@ func initDBPool(c *config) (*pgxpool.Pool, error) {
|
||||||
config.MaxConns = conf.DB.PoolSize
|
config.MaxConns = conf.DB.PoolSize
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := pgxpool.ConnectConfig(context.Background(), config)
|
var db *pgxpool.Pool
|
||||||
|
var err error
|
||||||
|
|
||||||
|
for i := 1; i < 10; i++ {
|
||||||
|
db, err = pgxpool.ConnectConfig(context.Background(), config)
|
||||||
|
if err == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(time.Duration(i*100) * time.Millisecond)
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
502
serv/rice-box.go
502
serv/rice-box.go
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,10 @@ version: '3.4'
|
||||||
services:
|
services:
|
||||||
# Postgres DB
|
# Postgres DB
|
||||||
db:
|
db:
|
||||||
image: postgres:11.5
|
image: postgres:12
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue