Skip to content

Commit

Permalink
Merge pull request #4952 from /issues/8689-1.5.x
Browse files Browse the repository at this point in the history
Fixes inconsistent conversion dates in logs - 1.5.x
  • Loading branch information
kjozwiak authored Mar 17, 2020
2 parents a003ea6 + 036bc8d commit e23d734
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ void AdConversionTracking::StartTimer(
const uint64_t now = Time::NowInSeconds();

uint64_t start_timer_in;
if (queue_item.timestamp_in_seconds < now) {
start_timer_in = now - queue_item.timestamp_in_seconds;
if (now < queue_item.timestamp_in_seconds) {
start_timer_in = queue_item.timestamp_in_seconds - now;
} else {
start_timer_in = brave_base::random::Geometric(
kExpiredAdConversionFrequency);
Expand All @@ -175,9 +175,10 @@ void AdConversionTracking::StartTimer(
return;
}

BLOG(INFO) << "Started ad conversion timer for uuid " << queue_item.uuid
<< " and creative set id " << queue_item.creative_set_id << " which will"
" trigger on " << Time::FromDoubleT(now + start_timer_in);
BLOG(INFO) << "Started ad conversion timer for creative_instance_id "
<< queue_item.uuid << " with creative set id "
<< queue_item.creative_set_id << " which will trigger on "
<< Time::FromDoubleT(queue_item.timestamp_in_seconds);
}

void AdConversionTracking::StopTimer() {
Expand Down

0 comments on commit e23d734

Please sign in to comment.