Replace time.time with arrow.utcnow().timestamp

arrow is imported already
This commit is contained in:
Matthias
2018-08-15 13:18:52 +02:00
parent 76914c2c07
commit baeffee80d
2 changed files with 8 additions and 8 deletions

View File

@@ -6,7 +6,6 @@ from random import randint
from typing import List, Dict, Tuple, Any, Optional
from datetime import datetime
from math import floor, ceil
import time
import asyncio
import ccxt
@@ -379,7 +378,7 @@ class Exchange(object):
logger.debug("one_call: %s", one_call)
input_coroutines = [self._async_get_candle_history(
pair, tick_interval, since) for since in
range(since_ms, int(time.time() * 1000), one_call)]
range(since_ms, arrow.utcnow().timestamp * 1000, one_call)]
tickers = await asyncio.gather(*input_coroutines, return_exceptions=True)
# Combine tickers
@@ -412,7 +411,7 @@ class Exchange(object):
# so we fetch it from local cache
if (not since_ms and
self._pairs_last_refresh_time.get(pair, 0) + interval_in_sec >=
int(time.time())):
arrow.utcnow().timestamp):
data = self._cached_klines[pair]
logger.debug("Using cached klines data for %s ...", pair)
else: