Jitendra12421 commited on
Commit
b5948d3
·
verified ·
1 Parent(s): 479f6da

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -18,6 +18,9 @@ def epoch_seconds(value):
18
  value = float(value)
19
  if value > 1e14: return int(value / 1e6)
20
  if value > 1e11: return int(value / 1e3)
 
 
 
21
  return int(value)
22
 
23
  def get_candles():
 
18
  value = float(value)
19
  if value > 1e14: return int(value / 1e6)
20
  if value > 1e11: return int(value / 1e3)
21
+ # Some previously cached Delta responses were stored as epoch milliseconds
22
+ # with three digits dropped (e.g. 1786405). Restore them to epoch seconds.
23
+ if 1e6 < value < 1e9: return int(value * 1000)
24
  return int(value)
25
 
26
  def get_candles():