File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 17
17
18
18
@define
19
19
class Product :
20
+ generic_symbol : str
20
21
symbol : str
21
22
product_account : str
22
23
price_account : str
@@ -81,26 +82,29 @@ async def _start_product_update_loop(self):
81
82
async def _upd_products (self ):
82
83
log .debug ("fetching product accounts from Pythd" )
83
84
pythd_products = {
84
- product .metadata .symbol : product
85
+ product .metadata .generic_symbol : product
85
86
for product in await self .pythd .all_products ()
86
87
}
87
88
log .debug ("fetched product accounts from Pythd" , products = pythd_products )
88
89
89
- old_products_by_symbol = {product .symbol : product for product in self .products }
90
+ old_products_by_generic_symbol = {
91
+ product .generic_symbol : product for product in self .products
92
+ }
90
93
91
94
self .products = []
92
95
93
- for symbol , product in pythd_products .items ():
96
+ for generic_symbol , product in pythd_products .items ():
94
97
if not product .prices :
95
98
continue
96
99
97
100
subscription_id = None
98
- if old_product := old_products_by_symbol .get (symbol ):
101
+ if old_product := old_products_by_generic_symbol .get (generic_symbol ):
99
102
subscription_id = old_product .subscription_id
100
103
101
104
self .products .append (
102
105
Product (
103
- symbol ,
106
+ generic_symbol ,
107
+ product .metadata .symbol ,
104
108
product .account ,
105
109
product .prices [0 ].account ,
106
110
product .prices [0 ].exponent ,
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class Price(DataClassJsonMixin):
24
24
@dataclass
25
25
class Metadata (DataClassJsonMixin ):
26
26
symbol : str
27
+ generic_symbol : str
27
28
28
29
29
30
@dataclass
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " example-publisher"
3
- version = " 1.1.1 "
3
+ version = " 1.1.2 "
4
4
description = " "
5
5
authors = []
6
6
license = " Apache-2"
You can’t perform that action at this time.
0 commit comments