Fixed the vol change in day bug (difference of uint64s was being assigned to an int32)
This commit is contained in:
1 parent
5f379c1356
commit
64a253b581
1 file changed
+5
-5
@@ -389,6 +389,8 @@ void AnalyticsServiceServer::archive_theos(
|
||||
void AnalyticsServiceServer::get_archived_theos(
|
||||
const bts::api::analytics::ArchivedTheoRetrieval &ret,
|
||||
const bts::api::Response<bts::api::analytics::ArchivedTheoList> &resp) {
|
||||
LOG(Gen, Info, "AnalyticsServiceServer::get_archived_theos ret: {}",
|
||||
utils::pb::to_string(ret));
|
||||
auto contains_st = [&](const ArchivedTheoList &tl) {
|
||||
for (const auto &st : tl.sec_tups()) {
|
||||
// TODO: compare all, just not symbol
|
||||
@@ -410,7 +412,7 @@ void AnalyticsServiceServer::get_archived_theos(
|
||||
utils::pb::from_string(kv.second, &tl);
|
||||
if (contains_st(tl)) {
|
||||
uint64_t ts = std::stoull(kv.first);
|
||||
int diff = ts - ret.save_time();
|
||||
int64_t diff = ts - ret.save_time();
|
||||
uint64_t abs_diff = std::abs(diff);
|
||||
if (abs_diff < max_diff) {
|
||||
key = kv.first;
|
||||
@@ -420,10 +422,8 @@ void AnalyticsServiceServer::get_archived_theos(
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG(Gen, Info,
|
||||
"AnalyticsServiceServer::get_archived_theo save_time: {} symbol: {} "
|
||||
"key: {}",
|
||||
ret.save_time(), ret.sec_tup().symbol(), key);
|
||||
LOG(Gen, Info, "AnalyticsServiceServer::get_archived_theos ret: {} key: {}",
|
||||
utils::pb::to_string(ret), key);
|
||||
resp(rv);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user