Skip to content

Commit 5bcbdd4

Browse files
authored
Merge pull request #4951 from /issues/8689-1.7.x
Fixes inconsistent conversion dates in logs - 1.7.x
2 parents e1dfa4c + 33672d8 commit 5bcbdd4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vendor/bat-native-ads/src/bat/ads/internal/ad_conversions.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ void AdConversions::StartTimer(
163163
const uint64_t now = Time::NowInSeconds();
164164

165165
uint64_t start_timer_in;
166-
if (info.timestamp_in_seconds < now) {
167-
start_timer_in = now - info.timestamp_in_seconds;
166+
if (now < info.timestamp_in_seconds) {
167+
start_timer_in = info.timestamp_in_seconds - now;
168168
} else {
169169
start_timer_in = brave_base::random::Geometric(
170170
kExpiredAdConversionFrequency);
@@ -179,7 +179,7 @@ void AdConversions::StartTimer(
179179
BLOG(INFO) << "Started ad conversion timer for creative_instance_id "
180180
<< info.creative_instance_id << " with creative set id "
181181
<< info.creative_set_id << " which will trigger on "
182-
<< Time::FromDoubleT(now + start_timer_in);
182+
<< Time::FromDoubleT(info.timestamp_in_seconds);
183183
}
184184

185185
void AdConversions::StopTimer() {

0 commit comments

Comments
 (0)