Skip to content

Commit 0c55143

Browse files
fix(ci): restore public repo checks and lint baseline (#18)
Co-authored-by: cloudingenium-automation[bot] <41898282+cloudingenium-automation[bot]@users.noreply.github.com>
1 parent b4b1720 commit 0c55143

6 files changed

Lines changed: 23 additions & 28 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
lint:
14-
runs-on: [self-hosted, Linux, Build]
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
- name: Set up Python 3.13
@@ -28,7 +28,7 @@ jobs:
2828
run: mypy bfxapi/
2929

3030
test:
31-
runs-on: [self-hosted, Linux, Build]
31+
runs-on: ubuntu-24.04
3232
steps:
3333
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434
- name: Set up Python 3.13

.github/workflows/copilot-reviewer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ permissions:
88

99
jobs:
1010
request:
11-
uses: CloudIngenium/.github/.github/workflows/request-copilot-review.yml@main
11+
uses: CloudIngenium/.github/.github/workflows/request-copilot-review.yml@24fac1de6a37800bae89a7b4f858742c7a455043
1212
secrets: inherit

.github/workflows/secret-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ concurrency:
2929
jobs:
3030
gitleaks:
3131
name: Secret Scan
32-
runs-on: [self-hosted, Linux, Build]
32+
runs-on: ubuntu-24.04
3333
timeout-minutes: 5
3434
permissions:
3535
contents: read

.github/workflows/socket-security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ concurrency:
1111
cancel-in-progress: true
1212
jobs:
1313
socket:
14-
uses: CloudIngenium/.github/.github/workflows/socket-security.yml@main
14+
uses: CloudIngenium/.github/.github/workflows/socket-security.yml@24fac1de6a37800bae89a7b4f858742c7a455043
1515
secrets: inherit

bfxapi/rest/_interface/middleware.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@
88
from enum import IntEnum
99
from typing import TYPE_CHECKING, Any, NoReturn
1010

11-
_NONCE_LOCK = threading.Lock()
12-
_NONCE_LAST = 0
13-
14-
15-
def _next_nonce() -> str:
16-
"""Monotonic microsecond nonce. Guards against duplicates when two calls
17-
hit the same microsecond tick under concurrent use (H8 fix)."""
18-
global _NONCE_LAST
19-
with _NONCE_LOCK:
20-
candidate = time.time_ns() // 1_000
21-
if candidate <= _NONCE_LAST:
22-
candidate = _NONCE_LAST + 1
23-
_NONCE_LAST = candidate
24-
return str(candidate)
25-
2611
import requests
2712

2813
from bfxapi._utils.json_decoder import JSONDecoder
@@ -39,6 +24,21 @@ def _next_nonce() -> str:
3924
if TYPE_CHECKING:
4025
from requests.sessions import _Params
4126

27+
_NONCE_LOCK = threading.Lock()
28+
_NONCE_LAST = 0
29+
30+
31+
def _next_nonce() -> str:
32+
"""Monotonic microsecond nonce. Guards against duplicates when two calls
33+
hit the same microsecond tick under concurrent use (H8 fix)."""
34+
global _NONCE_LAST
35+
with _NONCE_LOCK:
36+
candidate = time.time_ns() // 1_000
37+
if candidate <= _NONCE_LAST:
38+
candidate = _NONCE_LAST + 1
39+
_NONCE_LAST = candidate
40+
return str(candidate)
41+
4242

4343
@dataclass
4444
class RateLimitInfo:

bfxapi/websocket/_handlers/auth_events_handler.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ class AuthEventsHandler:
5252
}
5353

5454
__SERIALIZERS: dict[str, _Serializer[Any]] = {
55-
abbr: ser
56-
for abbrs, ser in _GROUPED.items()
57-
for abbr in abbrs
55+
abbr: ser for abbrs, ser in _GROUPED.items() for abbr in abbrs
5856
}
5957

6058
def __init__(self, event_emitter: EventEmitter) -> None:
@@ -79,12 +77,9 @@ def handle(self, abbrevation: str, stream: Any) -> None:
7977
if serializer is not None:
8078
event = AuthEventsHandler.__ABBREVIATIONS[abbrevation]
8179

82-
if all(
83-
isinstance(sub_stream, list) for sub_stream in stream
84-
):
80+
if all(isinstance(sub_stream, list) for sub_stream in stream):
8581
data: Any = [
86-
serializer.parse(*sub_stream)
87-
for sub_stream in stream
82+
serializer.parse(*sub_stream) for sub_stream in stream
8883
]
8984
else:
9085
data = serializer.parse(*stream)

0 commit comments

Comments
 (0)