-
Notifications
You must be signed in to change notification settings - Fork 973
Reconcile is no longer triggered if there are no publishers in the ledger table. #13385
Conversation
@NejcZdovc let me know if this is a change that makes more sense to implement in to the bat-client itself, and not browser-side. Thanks! |
@ryanml well I think that solution is sadly not that simple. We need to define what actually happens in this case with contribution time should we push it back for 30 days or just fuzz it for couple of days. I think that if your table is empty I would push it back for 30 days. So we need to update reconcile timestamp. |
@NejcZdovc makes complete sense. Would we just be updating Either way, I'll work something out and we can review from there :) |
@ryanml we should set |
459b913
to
06f21a3
Compare
Codecov Report
@@ Coverage Diff @@
## master #13385 +/- ##
==========================================
- Coverage 56.78% 56.64% -0.15%
==========================================
Files 285 285
Lines 29038 29034 -4
Branches 4803 4803
==========================================
- Hits 16488 16445 -43
- Misses 12550 12589 +39
|
@NejcZdovc I think we're a little closer to the desired result now |
app/browser/api/ledger.js
Outdated
const publishers = ledgerState.getPublisher(state) | ||
if (publishers.isEmpty()) { | ||
const newReconcileTime = (new Date().getTime() + (ledgerUtil.milliseconds.day * 30)) | ||
client.setTimeUntilReconcile(newReconcileTime, (err, stateResult) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's extract this block into separate function and just call this function here. Also please replace this block in other places that you can find it with this new function. You don't need to pass newReconcileTime, you can just pass null
in, which will default to 30 days.
@NejcZdovc changes pushed |
app/browser/api/ledger.js
Outdated
@@ -2243,6 +2247,11 @@ const run = (state, delayTime) => { | |||
return | |||
} | |||
|
|||
const publishers = ledgerState.getPublisher(state) | |||
if (publishers.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's extend this check to if (publishers.isEmpty() && client.isReadyToReconcile(synopsis)) {
. This way we are not pushing back time every time run
is called, but we push it back only once every month.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NejcZdovc good call, changes pushed
@ryanml let's just squash this and we are good to go |
…n if there are no publishers in the ledger table.
a67cba1
to
6d3f795
Compare
@NejcZdovc squashed 👍 thanks for your guidance on this one! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me ++
@ryanml sure, not a problem |
Reconcile is no longer triggered if there are no publishers in the ledger table.
Reconcile is no longer triggered if there are no publishers in the ledger table.
Fixes #13325
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests