Skip to content

Commit

Permalink
Merge pull request #4951 from /issues/8689-1.7.x
Browse files Browse the repository at this point in the history
Fixes inconsistent conversion dates in logs - 1.7.x
  • Loading branch information
kjozwiak authored Mar 17, 2020
2 parents e1dfa4c + 33672d8 commit 5bcbdd4
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 5bcbdd4

Please sign in to comment.