Skip to content

Commit

Permalink
Issue 662 (#1874)
Browse files Browse the repository at this point in the history
* chore: only staging branch needs to deploy to staging

Signed-off-by: Miles Zhang <[email protected]>

* chore: add configuration for database timeout

Signed-off-by: Miles Zhang <[email protected]>

---------

Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid authored May 23, 2024
1 parent f32cdfa commit 14cd518
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ name: Deploy to staging
on:
push:
branches:
- develop
- staging
tags:
- staging
- '*-rc*'
- "*-rc*"
jobs:
build:
uses: ./.github/workflows/build.yml
Expand All @@ -16,7 +15,14 @@ jobs:
needs: build
strategy:
matrix:
workload: [ckb-explorer-api, ckb-explorer-poolsyncer, ckb-explorer-scheduler, ckb-explorer-blocksyncer, ckb-explorer-worker]
workload:
[
ckb-explorer-api,
ckb-explorer-poolsyncer,
ckb-explorer-scheduler,
ckb-explorer-blocksyncer,
ckb-explorer-worker,
]
uses: ./.github/workflows/update-image.yml
with:
k8s-namespace: staging
Expand Down
6 changes: 5 additions & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ default: &default
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 25 } %>
username: <%= ENV.fetch("DB_USERNAME") { "postgres" } %>
password: <%= ENV.fetch("DB_PASSWORD") { "postgres" } %>
reconnect: true
reaping_frequency: 60 # every 60s check pool
timeout: 5000 # over 5s will timeout
variables:
statement_timeout: 120000 # query timemout over 120s
idle_in_transaction_session_timeout: 60000 # idle transaction over 60s

development:
<<: *default
Expand Down

0 comments on commit 14cd518

Please sign in to comment.