Skip to content

Commit ed68448

Browse files
committed
fix: more todos
1 parent d168be1 commit ed68448

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

openmeter/entitlement/balanceworker/entitlementhandler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func (w *Worker) processEntitlementEntity(ctx context.Context, entitlementEntity
163163

164164
var err error
165165
var snapshot marshaler.Event
166+
// TODO: This must not be in scope for high watermark cache or we are adding negative estimations!!!
166167
if opts.useEstimator && entitlementEntity.EntitlementType == entitlement.EntitlementTypeMetered {
167168
snapshot, err = w.createSnapshotEventEstimator(ctx, entitlementEntity, calculatedAt, opts)
168169
if err != nil {

openmeter/entitlement/balanceworker/entitlementthreshold.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ func (w *Worker) hitsWatchedThresholds(ctx context.Context, ent entitlement.Enti
2121
return false, fmt.Errorf("failed to get next active thresholds: %w", err)
2222
}
2323

24+
// TODO: Let's check if overage / usage is correctly handled in the code (e.g. > 100% notifications etc)
25+
2426
if nextThreshold != nil {
2527
if entitlementEnt.ApproxUsage.GreaterThanOrEqual(estimator.NewInfDecimalFromDecimal(*nextThreshold)) {
2628
return true, nil

0 commit comments

Comments
 (0)