Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Randomise promotions intervals #12657

Merged
merged 1 commit into from
Feb 8, 2018

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jan 15, 2018

Resolves #12355

Auditors:

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

  • enable ledger
  • make sure that promotions is checked on every 20-24 hours

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@NejcZdovc NejcZdovc self-assigned this Jan 15, 2018
@NejcZdovc NejcZdovc requested review from bsclifton and evq January 15, 2018 13:23
@NejcZdovc NejcZdovc force-pushed the hotfix/#12355-random branch from ea61c0d to 39126fc Compare January 15, 2018 13:26
@codecov-io
Copy link

codecov-io commented Jan 15, 2018

Codecov Report

Merging #12657 into master will decrease coverage by 0.06%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master   #12657      +/-   ##
==========================================
- Coverage    56.2%   56.14%   -0.07%     
==========================================
  Files         278      278              
  Lines       27118    27140      +22     
  Branches     4393     4393              
==========================================
- Hits        15241    15237       -4     
- Misses      11877    11903      +26
Flag Coverage Δ
#unittest 56.14% <50%> (-0.07%) ⬇️
Impacted Files Coverage Δ
app/browser/api/ledger.js 54.41% <50%> (-0.82%) ⬇️


promotionTimeoutId = setTimeout(() => {
checkPromotions()
}, random.randomInt({min: 20 * ledgerUtil.milliseconds.second, max: 24 * ledgerUtil.milliseconds.second}))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these be ledgerUtil.milliseconds.hour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are correct, I was using seconds to test code out and forgot to change it back, nice catch

Resolves brave#12355

Auditors:

Test Plan:
@NejcZdovc NejcZdovc force-pushed the hotfix/#12355-random branch from 39126fc to a95e859 Compare January 16, 2018 05:09
@NejcZdovc NejcZdovc requested a review from evq January 16, 2018 05:10
@NejcZdovc NejcZdovc added this to the 0.20.x Hotfix 1 milestone Jan 16, 2018
@alexwykoff alexwykoff modified the milestones: 0.20.x Hotfix 3 (Ledger improvments), 0.21.x (Beta Channel) Feb 6, 2018
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@bsclifton bsclifton merged commit 68b5444 into brave:master Feb 8, 2018
bsclifton added a commit that referenced this pull request Feb 8, 2018
bsclifton added a commit that referenced this pull request Feb 8, 2018
@bsclifton
Copy link
Member

master 68b5444
0.22.x 7257bbf
0.21.x e508df0

@NejcZdovc NejcZdovc modified the milestones: 0.21.x (Beta Channel), 0.21.x (Twitch) Feb 24, 2018
NejcZdovc pushed a commit that referenced this pull request Feb 24, 2018
@NejcZdovc
Copy link
Contributor Author

0.21 twitch cd11167

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants