Skip to content

Commit

Permalink
Fixes inconsistent conversion dates in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmancey committed Mar 16, 2020
1 parent c3f789d commit 33672d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vendor/bat-native-ads/src/bat/ads/internal/ad_conversions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ void AdConversions::StartTimer(
const uint64_t now = Time::NowInSeconds();

uint64_t start_timer_in;
if (info.timestamp_in_seconds < now) {
start_timer_in = now - info.timestamp_in_seconds;
if (now < info.timestamp_in_seconds) {
start_timer_in = info.timestamp_in_seconds - now;
} else {
start_timer_in = brave_base::random::Geometric(
kExpiredAdConversionFrequency);
Expand All @@ -179,7 +179,7 @@ void AdConversions::StartTimer(
BLOG(INFO) << "Started ad conversion timer for creative_instance_id "
<< info.creative_instance_id << " with creative set id "
<< info.creative_set_id << " which will trigger on "
<< Time::FromDoubleT(now + start_timer_in);
<< Time::FromDoubleT(info.timestamp_in_seconds);
}

void AdConversions::StopTimer() {
Expand Down

0 comments on commit 33672d8

Please sign in to comment.