yfinance-exporter 1.0.7__py3-none-any.whl → 1.0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
|
|
1
|
+
yfinance_exporter.py,sha256=roRbAtpbrxqTm2sfrtQ1m05lR3_l_jPOE5NvuO1HSlM,4399
|
2
|
+
yfinance_exporter-1.0.9.dist-info/METADATA,sha256=OmEs0MDnOInsiDlwHMYgPNS-Sezp4slFlZG_y-Fzjnc,1525
|
3
|
+
yfinance_exporter-1.0.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
4
|
+
yfinance_exporter-1.0.9.dist-info/RECORD,,
|
yfinance_exporter.py
CHANGED
@@ -92,16 +92,18 @@ def collect(stock) -> bool:
|
|
92
92
|
|
93
93
|
|
94
94
|
def update_state(result: bool, key: str, states: dict, labels: dict):
|
95
|
-
logger.debug("%r: updating current state with result %r", key, result)
|
96
95
|
previous = states.get(key)
|
97
96
|
states[key] = result
|
98
97
|
if previous == result:
|
98
|
+
logger.debug("%r: result %r => %r UNCHANGED", key, previous, result)
|
99
99
|
return
|
100
100
|
inc_key, dec_key = "items-ok", "items-ko"
|
101
101
|
if not result:
|
102
102
|
inc_key, dec_key = "items-ko", "items-ok"
|
103
|
+
logger.debug("%s(%r => %r) %s-1", key, previous, result, inc_key)
|
103
104
|
DAEMON.labels(status=inc_key, **labels).inc()
|
104
105
|
if previous is not None:
|
106
|
+
logger.debug("%s(%r => %r) %s-1", key, previous, result, dec_key)
|
105
107
|
DAEMON.labels(status=dec_key, **labels).dec()
|
106
108
|
|
107
109
|
|
@@ -121,6 +123,7 @@ def main():
|
|
121
123
|
for stock in conf.stocks:
|
122
124
|
result = collect(stock)
|
123
125
|
update_state(result, stock.isin, states, labels)
|
126
|
+
logger.debug("Wating computed interval %r", in_loop_interval)
|
124
127
|
time.sleep(in_loop_interval)
|
125
128
|
|
126
129
|
exec_interval = (datetime.now() - start).total_seconds()
|
@@ -1,4 +0,0 @@
|
|
1
|
-
yfinance_exporter.py,sha256=2z-RR1kwyXqKnAsc_TmUJTGhvylMN6daNNMaSGxcsb0,4179
|
2
|
-
yfinance_exporter-1.0.7.dist-info/METADATA,sha256=xNxqoFlOunh-BktPy4mOFuQfq0mFJTqImCUh79_RLik,1525
|
3
|
-
yfinance_exporter-1.0.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
4
|
-
yfinance_exporter-1.0.7.dist-info/RECORD,,
|
File without changes
|