Skip to content

Commit

Permalink
Update default round in docker compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-roberts committed Dec 4, 2024
1 parent e063de4 commit a8c1641
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
15 changes: 5 additions & 10 deletions backend/routes/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@ func initCanvas(w http.ResponseWriter, r *http.Request) {
return
}

// Get round number from query params, default to config round
roundNumber := r.URL.Query().Get("round")
if roundNumber == "" {
roundNumber = strconv.FormatUint(uint64(core.ArtPeaceBackend.CanvasConfig.Round), 10)
}

canvasKey := fmt.Sprintf("canvas-%s", roundNumber)
roundNumber := core.ArtPeaceBackend.CanvasConfig.Round
canvasKey := fmt.Sprintf("canvas-%d", roundNumber)

if core.ArtPeaceBackend.Databases.Redis.Exists(context.Background(), canvasKey).Val() == 0 {
totalBitSize := core.ArtPeaceBackend.CanvasConfig.Canvas.Width * core.ArtPeaceBackend.CanvasConfig.Canvas.Height * core.ArtPeaceBackend.CanvasConfig.ColorsBitWidth
Expand All @@ -46,9 +41,9 @@ func initCanvas(w http.ResponseWriter, r *http.Request) {
return
}

routeutils.WriteResultJson(w, fmt.Sprintf("Canvas for round %s initialized", roundNumber))
routeutils.WriteResultJson(w, fmt.Sprintf("Canvas for round %d initialized", roundNumber))
} else {
routeutils.WriteErrorJson(w, http.StatusConflict, fmt.Sprintf("Canvas for round %s already initialized", roundNumber))
routeutils.WriteErrorJson(w, http.StatusConflict, fmt.Sprintf("Canvas for round %d already initialized", roundNumber))
}
}

Expand All @@ -58,7 +53,7 @@ func getCanvas(w http.ResponseWriter, r *http.Request) {
// Get round number from query params, default to config round
roundNumber := r.URL.Query().Get("round")
if roundNumber == "" {
roundNumber = strconv.FormatUint(uint64(core.ArtPeaceBackend.CanvasConfig.Round), 10)
roundNumber = strconv.Itoa(int(core.ArtPeaceBackend.CanvasConfig.Round))
}

canvasKey := fmt.Sprintf("canvas-%s", roundNumber)
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- POSTGRES_PASSWORD=password
- ART_PEACE_END_TIME=3000000000
- ART_PEACE_HOST=0328ced46664355fc4b885ae7011af202313056a7e3d44827fb24c9d3206aaa0
- ROUND_NUMBER=1
- ROUND_NUMBER=2
volumes:
- nfts:/app/nfts
consumer:
Expand All @@ -50,7 +50,7 @@ services:
restart: always
environment:
- POSTGRES_PASSWORD=password
- ROUND_NUMBER=1
- ROUND_NUMBER=2
volumes:
- nfts:/app/nfts
- worlds:/app/worlds
Expand Down Expand Up @@ -143,7 +143,7 @@ services:
- devnet
environment:
- REACT_APP_BASE_PIXEL_TIMER=30000
- REACT_APP_ROUND_NUMBER=1
- REACT_APP_ROUND_NUMBER=2
volumes:
- ./frontend/package.json:/app/package.json
- ./frontend/package-lock.json:/app/package-lock.json
Expand Down
6 changes: 3 additions & 3 deletions main-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- POSTGRES_PASSWORD=password
- ART_PEACE_END_TIME=3000000000
- ART_PEACE_HOST=0328ced46664355fc4b885ae7011af202313056a7e3d44827fb24c9d3206aaa0
- ROUND_NUMBER=1
- ROUND_NUMBER=2
consumer:
build:
dockerfile: backend/Dockerfile.consumer
Expand All @@ -48,7 +48,7 @@ services:
restart: always
environment:
- POSTGRES_PASSWORD=password
- ROUND_NUMBER=1
- ROUND_NUMBER=2
volumes:
- nfts:/app/nfts
devnet:
Expand Down Expand Up @@ -140,7 +140,7 @@ services:
- devnet
environment:
- REACT_APP_BASE_PIXEL_TIMER=30000
- REACT_APP_ROUND_NUMBER=1
- REACT_APP_ROUND_NUMBER=2
volumes:
- ./frontend/package.json:/app/package.json
- ./frontend/package-lock.json:/app/package-lock.json
Expand Down

0 comments on commit a8c1641

Please sign in to comment.