Skip to content

Commit dcffaf2

Browse files
Fix crash when using custom datasources (#651)
1 parent bba142d commit dcffaf2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
66

77
## [Unreleased]
88

9-
### Fixes
9+
### Fixed
1010

1111
- config: Enable early realtime mode when config contains bigmap indexes with `skip_history`.
12+
- http: Fixed crash when using custom datasources.
1213

1314
## [6.5.4] - 2022-03-31
1415

src/dipdup/datasources/datasource.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838

3939
class Datasource(HTTPGateway):
40+
_default_http_config = HTTPConfig()
41+
4042
def __init__(self, url: str, http_config: HTTPConfig | None = None) -> None:
4143
config = ResolvedHTTPConfig.create(self._default_http_config, http_config)
4244
super().__init__(url, config)

src/dipdup/http.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from aiolimiter import AsyncLimiter
2222

2323
from dipdup import __version__
24-
from dipdup.config import HTTPConfig
2524
from dipdup.config import ResolvedHTTPConfig
2625
from dipdup.exceptions import FrameworkException
2726
from dipdup.exceptions import InvalidRequestError
@@ -38,8 +37,6 @@
3837
class HTTPGateway(AbstractAsyncContextManager[None]):
3938
"""Base class for datasources which connect to remote HTTP endpoints"""
4039

41-
_default_http_config: HTTPConfig
42-
4340
def __init__(self, url: str, http_config: ResolvedHTTPConfig) -> None:
4441
self._http_config = http_config
4542
self._http = _HTTPGateway(url, self._http_config)

0 commit comments

Comments
 (0)