Skip to content

Commit

Permalink
Merge pull request #787 from BoltzExchange/cleanup-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
michael1011 authored Jan 15, 2025
2 parents 5d16749 + 287257f commit 0bca75a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: CI

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
build:
strategy:
matrix:
platform: [ ubuntu-latest ]
node-version: [ 20 ]
rust-version: [ stable ]
platform: [ubuntu-latest]
node-version: [20]
rust-version: [stable]

runs-on: ${{ matrix.platform }}

Expand All @@ -33,7 +33,9 @@ jobs:
matrix.rust-version }}

- name: Install build dependencies
run: sudo apt-get update && sudo apt-get -y install protobuf-compiler
run:
sudo apt-get update && sudo apt-get -y install protobuf-compiler
libsqlite3-dev

- name: Install Node.js dependencies
run: npm ci
Expand Down Expand Up @@ -80,9 +82,9 @@ jobs:
build-rust:
strategy:
matrix:
platform: [ ubuntu-latest ]
node-version: [ 20 ]
rust-version: [ stable, nightly ]
platform: [ubuntu-latest]
node-version: [20]
rust-version: [stable, nightly]

runs-on: ${{ matrix.platform }}

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker
on:
workflow_dispatch:
push:
branches: ["master"]
branches: ['master']

jobs:
push:
Expand All @@ -29,4 +29,6 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push backend image
run: ./docker/build.py buildx --platform linux/amd64 --no-latest --branch ${GITHUB_REF##*/} boltz
run:
./docker/build.py buildx --platform linux/amd64 --no-latest --branch
${GITHUB_REF##*/} boltz
7 changes: 5 additions & 2 deletions boltzr/src/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::config::GlobalConfig;
use pyroscope::pyroscope::PyroscopeAgentRunning;
use pyroscope::PyroscopeAgent;
use pyroscope_pprofrs::{pprof_backend, PprofConfig};
use tracing::{error, warn};
use tracing::{error, info, warn};

pub fn start(config: &GlobalConfig) -> Option<PyroscopeAgent<PyroscopeAgentRunning>> {
let endpoint = match &config.profiling_endpoint {
Expand All @@ -24,7 +24,10 @@ pub fn start(config: &GlobalConfig) -> Option<PyroscopeAgent<PyroscopeAgentRunni

let err = match agent {
Ok(agent) => match agent.start() {
Ok(agent) => return Some(agent),
Ok(agent) => {
info!("Enabling profiler");
return Some(agent);
}
Err(err) => err,
},
Err(err) => err,
Expand Down
8 changes: 5 additions & 3 deletions lib/db/repositories/StatsRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ ORDER BY year, month, pair NULLS FIRST;
// language=PostgreSQL
`
WITH data AS (
SELECT pair, 'submarine' AS type, status, referral, "createdAt"
SELECT pair, 'submarine' AS type, status, "failureReason", referral, "createdAt"
FROM swaps
UNION ALL
SELECT pair, 'reverse' AS type, status, referral, "createdAt"
SELECT pair, 'reverse' AS type, status, "failureReason",referral, "createdAt"
FROM "reverseSwaps"
UNION ALL
SELECT pair, 'chain' AS type, status, referral, "createdAt"
SELECT pair, 'chain' AS type, status, "failureReason", referral, "createdAt"
FROM "chainSwaps"
)
SELECT
Expand All @@ -174,6 +174,7 @@ SELECT
type,
COUNT(*) FILTER (
WHERE status IN (?)
AND "failureReason" NOT IN (?)
) / CAST(COUNT(*) AS REAL) AS "failureRate"
FROM data
WHERE
Expand Down Expand Up @@ -389,6 +390,7 @@ GROUP BY pair, type;
SwapUpdateEvent.InvoiceFailedToPay,
SwapUpdateEvent.TransactionRefunded,
],
['invoice expired', 'swap expired'],
referral,
referral,
minYear,
Expand Down

0 comments on commit 0bca75a

Please sign in to comment.